摘要: <%@ OutputCache Duration="15" VaryByParam="none" %> 使用页面输出缓存<%@ OutputCache Duration="3600" VaryByParam="id" %> 使用参数变化输出缓存<%@ OutputCache Duration="3600" VaryByControl="DropDownList1" %> 基于控件变化的输出缓存<%@ OutputCache Durat 阅读全文
posted @ 2013-02-18 16:26 yellowshorts 阅读(216) 评论(0) 推荐(0) 编辑
摘要: //在session状态中保存数据库数据 DataView dvMovies; dvMovies = (DataView)Session["Movies"]; if (dvMovies==null) { string constring = "Data Source=.;Initial Catalog=BalloonShop;Integrated Security=True"; SqlDataAdapter dad = new SqlDataAd... 阅读全文
posted @ 2013-02-18 10:46 yellowshorts 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1//记录页面被请求的次数 int counter = 0; if (Request.Cookies["counter"]!=null) { counter = Int32.Parse(Request.Cookies["counter"].Value);//读取cookies } counter++; Response.Cookies["counter"].Value = counter.ToString();//创建cookies ... 阅读全文
posted @ 2013-02-18 10:08 yellowshorts 阅读(144) 评论(0) 推荐(0) 编辑