随笔分类 - ASP.NET
摘要:web.config中配置 <system.webServer> <defaultDocument> <files> <clear /> <add value="Login.aspx" /> </files> </defaultDocument> </system.webServer>
阅读全文
摘要:存放缓存 #region 存放对应缓存 Cache cache = HttpRuntime.Cache; //文件缓存依赖 cache.Insert("CC", "依赖项测试", new CacheDependency(@"D:\123.txt")); //这时候在about.aspx页面添加一行代
阅读全文
摘要:概述 清空缓存主要通过Remove()方法,但是只能通过传入一个Key,清空一个。GetEnumerator()方法用于获取所有缓存项。MoveNext()用于将位置移动到下一个缓存项。如果想清空所有缓存,由于Cache类没有提供RemoveAll()方法,所以可以通过以下方式实现: public
阅读全文
摘要:Add() object Add(string key, object value, CacheDependency dependencies, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority pr
阅读全文
摘要:CacheItemUpdateCallback和CacheItemRemoveCallback区别 CacheItemUpdateCallback 缓存数据移除之前调用; CacheItemRemoveCallback 缓存数据移除之后调用; 案例分析 : public class Program
阅读全文
摘要:关于程式刚刚打开时候出现长时间等待解决方案 1.在程式初始化时,WebDataSource绑定InfoCommand中的SQL查询时,调用SetWhere("1=0")方法,让程式刚刚载入时不查询数据。 if (!IsPostBack) { InitializeComponent(); wdsR_Q
阅读全文
摘要:LINQ基础—Distinct子句 一、简介 Distinct返回的序列包含输入序列的唯一元素,该语句是单个集合操作。 二、案例 List<int> list = new List<int>() {1,2,3,3,3}; var result = list.Distinct(); Result的结果
阅读全文
摘要:WebGridView 绑定的某个栏位动态填充背景 代码: protected void wgvQUERY_DataBound(object sender, EventArgs e) { for (int i = 0; i < wgvQUERY.Rows.Count; i++) { var str
阅读全文