<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. 徒手用Java来写个Web服务器和框架吧<第一章:NIO篇>

    因为有个不会存在大量连接的小的Web服务器需求,不至于用上重量级服务器,于是自己动手写一个服务器. 同时也提供了一个简单的Web框架.能够简单的使用了. 大体的需求包括 能够处理HTTP协议. 能够提 ...

  2. 3856: Monster

    3856: Monster Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 351  Solved: 161[Submit][Status][Discuss ...

  3. CAAnimation动画--(旋转/缩放/移动/闪烁)

    p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #1d9421 } p.p2 { margin: 0.0px 0. ...

  4. 同步 VS 异步

    同步请求资源 请求msdn上的一个页面计算页面大小 static void Main(string[] args) { string url = "https://docs.microsof ...

  5. python 机器学习 K-近邻算法

    本人想边写文章,边学习,用的是 网上最火的<机器学习实战>machine learning in action 来做一次实践. 希望在过程中理顺思路之余,也有分享自己的一些理解,学习.加油 ...

  6. 安卓Android的内存管理原理解析

    Android采取了一种有别于Linux的进程管理策略,有别于Linux的在进程活动停止后就结束该进程,Android把这些进程都保留在内存中,直到系统需要更多内存为止.这些保留在内存中的进程通常情况 ...

  7. mybatis基础学习2---(resultType和resultMap的用法和区别)和setting的用法

    1:resultType和resultMap两者只能有一个成立 2:resultMap可以解决复杂查询时的映射问题 3:使用 resultType使用 ------------------------ ...

  8. (转)Uploadify 3.2 参数属性、事件、方法函数详解

    转自http://blog.sina.com.cn/s/blog_5079086b0101fkmh.html Hallelujah博客 一.属性 属性名称 默认值 说明 auto true 设置为tr ...

  9. java学习笔记 --- StringBuffer类

    1.定义:字符串缓冲区,即它是一个容器,容器中可以装很多字符.并且能够对其中的字符进行各种操作. StringBuffer的特点: 1.是一个字符串缓冲区,其实就是一个容器. 2.长度是可变,任意类型 ...

  10. iOS开发之NSOperation & NSOperationQueue

    1.简介 (1) NSOperationQueue(操作队列)是由GCD提供的队列模型的Cocoa抽象,是一套Objective-C的API,为了使并发(多线程)编程变得更加简单,但效率比GCD略低. ...