ASP.NET禁用URL缓存
在一个项目开发中,showdialog弹出对话框时,我之前修改过的数据不会及时更新!
使用禁用URL缓存的方法,解决这个问题
在asp.net页面的后台
if (!IsPostBack)
{
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
}
相关文档:
一、目前在ASP.NET中页面传值共有这么几种方式:
1、表单提交,
<form action= "target.aspx" method = "post" name = "form1">
<input name = "param1" value = "1111"/>
<input name = "param2" value = "2222"/>
</form>
....
for ......
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1 ......
asax文件:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="counter.ascx.cs" Inherits="JiAnWeb.counter" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<LINK href="css.css" rel="stylesheet">
<FONT face="宋体">
<TABLE id="table_coun ......
ASP.NET 4的Web Forms当中,最令人激赏的,则莫过于是URL Routing机制的全面支持。过去在ASP.NET 3.5 SP1当中,Web Forms或多或少就开始支持URL Routing机制,它让我们在网址的呈现以及使用上更加的有弹性。
过去我们在ASP.NET当中,习惯于底下这样的网址呈现方式:
http://myWebSite/EditProduct.aspx?Id=1
但最近几年R ......