<div id="calendar_contain">
</div> <script language="javascript" src="js/event.js"></script> <link href="css/gallery.css" rel="stylesheet" type="text/css" /> <script type="text/javascript">
$.ajax({
type: "post",
datatype: "json",
url: "Handler/DHallZTinfo.ashx",
async: false, //异步发送
success: function(rdata) {
rdata = $.parseJSON(rdata); //转换成json格式
for (var item = ; item < rdata.length; item++) {
hashMap.Set("" + rdata[item].time + "", "<a href=" + rdata[item].url + ">" + rdata[item].title + "</a>");
}
}
}); function Offset(e) {
var t = e.offsetTop;
var l = e.offsetLeft;
var w = e.offsetWidth;
var h = e.offsetHeight - ;
while (e = e.offsetParent) {
t += e.offsetTop;
l += e.offsetLeft;
}
return {
top: t,
left: l,
width: w,
height: h
}
} function itemShow(id) {
document.getElementById(id + "s").className = "calendarEventHov";
document.getElementById(id).style.display = "block";
} function itemHide(id) {
document.getElementById(id + "s").className = "calendarEvent";
document.getElementById(id).style.display = "none";
} //转换日期成字符串,例如2008年8月31日转换成'20080831'
function dateToString(date) {
return date.getFullYear() + this.digitFix(date.getMonth() + , ) + this.digitFix(date.getDate(), );
} //修正当前单数的月份为两位,例如'8'->'08'
function digitFix(number, count) {
var _string = number + "";
var _count = count - _string.length;
for (var i = ; i < _count; i++)
_string = "" + _string;
return _string;
}
var monthArray = ["1月", "2月", "3/月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]; </script> <script src="js/JCalendar.js" type="text/javascript"></script> <script type="text/javascript">
document.getElementById("calendar_contain").innerHTML = new JCalendar().show();
JCalendar.update(); $(function() {
/* 日历 右上角按钮*/
$('.preMonth').mouseover(function() {
$(this).attr('class', 'preMonthHov');
}).mouseout(function() {
$(this).attr('class', 'preMonth');
}); $('.nextMonth').mouseover(function() {
$(this).attr('class', 'nextMonthHov');
}).mouseout(function() {
$(this).attr('class', 'nextMonth');
}); /*显示事件安排弹出框*/
$('.calendarEvent').mouseover(function() {
$(this).css('z-index', '');
$(this).attr('class', 'calendarEventHov');
$(this).find('.calendarShowBox').show();
}).mouseout(function() {
$(this).css('z-index', '');
$(this).attr('class', 'calendarEvent');
$(this).find('.calendarShowBox').hide();
});
});
</script> ///
<%@ WebHandler Language="C#" Class="DHallZTinfo" %>

using System;
using System.Web;
using System.Data;
public class DHallZTinfo : IHttpHandler
{ public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
DataTable dtdhallInfo = SystemBLL.information.Instance.selectinfobyzongid(, );//绑定日历上要显示的通知
context.Response.Write(GetJson(dtdhallInfo));
} /// <summary>
/// 编写json格式
/// </summary>
/// <param name="dt"></param>
/// <returns></returns>
private string GetJson(DataTable dt)
{
string url = "";
string strlv = "";
string flag = "";
string strid = ""; System.Text.StringBuilder _sb = new System.Text.StringBuilder(); if (dt == null || dt.Rows.Count == ) return "[]"; _sb.Append("["); int tmpRows = dt.Rows.Count; for (int i = ; i < tmpRows; i++)
{
url = dt.Rows[i]["info_url"].ToString();
strlv = dt.Rows[i]["info_lb"].ToString();
flag = dt.Rows[i]["info_zong"].ToString();
strid = dt.Rows[i]["info_id"].ToString();
if (url == "#")
{
url = "Show.aspx?info_lb=" + strlv + "&info_id=" + strid + "&flag=" + flag;
} _sb.Append("{ \"time\":\"" + GetTimeinfo(dt.Rows[i].Field<DateTime>("info_addtime")) + "\", \"url\":\"" + url + "\", \"title\":\"" + dt.Rows[i].Field<string>("info_title") + "\"}"); }
_sb.Append("]");
System.Collections.Generic.List<object> list = new System.Collections.Generic.List<object>();
foreach (var item in dt.AsEnumerable())
{
list.Add(new
{
id = item.Field<int>("id"),
url = GetUrl("", "", "", "")
});
} // var jsonstr = Newtonsoft.Json.JsonConvert.SerializeObject(dt);
// var jsonstr2 = Newtonsoft.Json.JsonConvert.SerializeObject(list); return _sb.ToString();
}
private string GetUrl(string strlv, string strid, string flag, string url)
{
if (url == "#")
{
return url = "Show.aspx?info_lb=" + strlv + "&info_id=" + strid + "&flag=" + flag;
}
return url;
} /// <summary>
/// 获取时间
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public string GetTimeinfo(DateTime time)
{
return time.ToString("yyyyMMdd");
} public bool IsReusable
{
get
{
return false;
}
} } //效果:
不知道怎么上传js文件。需要的可以问我要先关文件~~

日历上添加活动通知(Asp.net)的更多相关文章

  1. ASP.NET#在设计窗口上添加了一个SqlDataSource控件后,没有显示出来?

    在设计窗口上添加了一个SqlDataSource控件后,没有显示出来,但后台代码是有的 处理的办法:菜单栏->视图->可视辅助->ASP.NET非可视控件 (我用的是VS2012)

  2. 在 Mac OS 上使用 TypeScript 编写 ASP.NET Core 1.0 应用

    var appInsights=window.appInsights||function(config){ function r(config){t[config]=function(){var i= ...

  3. Android 向系统日历中添加事件

    查了一天半,总算有点大概了.以下是自己的理解,有错误的地方望指正. android系统有日历功能,应用程序可以根据一些接口开发自己的功能,即使是日历app也是根据这些接口开发的,所以我们可以利用程序向 ...

  4. Flash上传文件(结合asp.net)

    一.实现原理.在某些场合,我们需要使用Flash进行“文件上传”,原因是Flash 能制作出表现力丰富的UI界面. (自负又孤陋寡闻的我在这里做一个补充:Flash使用flash.net包中的File ...

  5. 读取Excel任务列表并显示在Outlook日历上

    前几天,公司发了一个任务安排,时间不固定,但要求准时到,为了给自己加一个提醒,也为了回顾一下以前的技术,特做了一个Demo. 读取Excel就不多说了,代码很简单,但支持老版本Excel和的版本Exc ...

  6. 【百度地图API】如何在地图上添加标注?——另有:坐标拾取工具+打车费用接口介绍

    原文:[百度地图API]如何在地图上添加标注?--另有:坐标拾取工具+打车费用接口介绍 摘要: 在这篇文章中,你将学会,如何利用百度地图API进行标注.如何使用API新增的打车费用接口. ------ ...

  7. [原]逆向iOS SDK -- “添加本地通知”的流程分析

    观点: 代码面前没有秘密 添加通知的 Demo 代码 - (void)scheduleOneLocalNotification { [[UIApplication sharedApplication] ...

  8. 002.Create a web API with ASP.NET Core MVC and Visual Studio for Windows -- 【在windows上用vs与asp.net core mvc 创建一个 web api 程序】

    Create a web API with ASP.NET Core MVC and Visual Studio for Windows 在windows上用vs与asp.net core mvc 创 ...

  9. Android训练课程(Android Training) - 添加活动栏(使用action bar)

    2014-10-28 张云飞VIR 翻译自:https://developer.android.com/training/basics/actionbar/index.html 添加活动栏(Addin ...

随机推荐

  1. SpringCache缓存初探

    body,table tr { background-color: #fff } table tr td,table tr th { border: 1px solid #ccc; text-alig ...

  2. [干货来袭]C#7.0新特性(VS2017可用)

    前言 微软昨天发布了新的VS 2017 ..随之而来的还有很多很多东西... .NET新版本 ASP.NET新版本...等等..太多..实在没消化.. 分享一下其实2016年12月就已经公布了的C#7 ...

  3. 【2017-2-17】VS基本应用及C#基础第一节(定义变量、输入及输出)

    一VS基本应用 (一)新建项目 新建项目可有多种方法例如: 1.  在VS起始页面建立新项目 2.  在集成环境中,通过"文件"/"新建"/"项目&q ...

  4. 1230: [Usaco2008 Nov]lites 开关灯

    1230: [Usaco2008 Nov]lites 开关灯 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1162  Solved: 589[Sub ...

  5. resin远程调试配置,connection refused问题解决

    http://john521.iteye.com/blog/1879805 这篇博客中讲的很好. 我在配置的过程中遇到了几个问题,记录一下: 1. 调试服务器监听的端口号,百度的开发机都限制了端口在某 ...

  6. mac 下 wget 安装

    1.下载 wget 压缩包,wget 下载地址:ftp://ftp.gnu.org/gnu/wget/ 2.make && make install 3.如果提示 permission ...

  7. 使用spring webflow,在前台页面中如何显示后端返回的错误信息

    刚刚接触spring webflow,相关的资料并不是很多,并且大都是那种入门的 .xml文件的配置. 用到的CAS 最新的4.0版本用的就是web-flow流,前台页面使用的是表单提交.于是我就碰到 ...

  8. IE浏览器img不显示解决

    下面的只是一个我们在网页中插入一个图片的简单例子,浏览的时候我们也没有任何问题 <!doctype html> <html> <head> <meta cha ...

  9. 对Vue.js $watch方法的理解

    博主最近对着vue.js的官方教程在自学vue.js,博主自幼愚钝,在教程中真的是好多点都不太理解,接下来要说的这个$watch方法就是其中一个不太理解的点了.咱们先来看一下对于$watch方法在vu ...

  10. 第一篇Active Directory疑难解答概述(1)

    后期预告:从接下来我会给大家讲解,Active Directory 活动目录重要性,以及在日常管理运维中如和去排查问你题.俗话说,一个不健康的Active Directory环境是不健康的Exchan ...