关于数据页面缓存问题,大家帮我可那看这个那里错了?
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "Default.aspx.cs " Inherits= "_Default " %>
<%@ OutputCache Duration= "1000 " SqlDependency= "DLOcean:PORE_DATA " VaryByParam= "none " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN " "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head runat= "server ">
<title> Untitled Page </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<asp:ScriptManager ID= "ScriptManager1 " runat= "server " />
<div>
<table>
<tr>
<td>
<asp:Label ID= "lbl1 " runat= "server "> </asp:Label>
</td>
</tr>
<tr>
<td>
<asp:GridView ID= "gv1 " runat= "server " AllowPaging= "True " AutoGenerateColumns= "False " >
</asp:GridView>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
后台代码:
protected void Page_Load(object sender, EventArgs e)
{
this.lj();
}
private void lj()
{
DataSet ds=new DataSet();
SqlConnection con = new SqlConnection( "server=.;database=DLOcean;uid=sa;pwd=sa ");