随笔分类 -  C#

C#
摘要:asp.net mvc 清除视图缓存,消除缓存方法public ActionResult SearchCommunityPopulation(){ //禁止页面被缓存 Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Today.AddYears(-2)); return PartialView("Index", 数据源);} 阅读全文
posted @ 2013-01-15 14:32 yanggm 阅读(1470) 评论(1) 推荐(0)
摘要:这是通过微软office导出excel文件,为什么通过微软的office导出呢,因为我开始用的是npoi office导出,它不支持一种格式(就是html格式的excel文件),但是office支持,所以,写个博客,给大家分享,分享思维方式:通过读取文件的excel文件,再通过模版格式导出相应的格式/// <summary> /// 导出excel /// </summary> /// <param name="readFileName">读取文件路径</param> /// <param name="save 阅读全文
posted @ 2013-01-10 11:47 yanggm 阅读(966) 评论(0) 推荐(0)
摘要:首先说一下,有种情况就是session半个小时后自动失效,会出现跳到登录页面会有画中画的效果,然而可以通过Attribute解决,通常情况下一般都是通过ajax请求,所以呢,下面的方法可以解决 1 public class UserAuthorizeAttribute : AuthorizeAttribute 2 { 3 public override void OnAuthorization(AuthorizationContext filterContext) 4 { 5 // ajax 请求... 阅读全文
posted @ 2012-12-14 13:31 yanggm 阅读(378) 评论(1) 推荐(0)
摘要:前言:百度地图标注物数据加载结合百度API(http://openapi.baidu.com/map/jsdemo.htm) 和百度拾取坐标系统(http://dev.baidu.com/wiki/static/map/API/tool/getPoint/)二者缺一不可,下面就来说说详细的调用和实现方法.(说明:用的是asp.net mvc 3)1.前端页面代码 1 @{ 2 Layout = null; 3 } 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <title>地图展示</title> 8 & 阅读全文
posted @ 2012-12-13 16:21 yanggm 阅读(1734) 评论(3) 推荐(0)