hi
i'm having one application in that i'm using one session variable.
my code works fine till the user hits refresh button but
after this session variable becomes empty.
below is the code i'm using
string RenderedOutput = string.Empty;
public static int Index = 0;
DataTable dt = new DataTable();
DataRow dr;
DataView dv;
protected void Page_Load(object sender, EventArgs e)
{
ClientScriptManager scriptMgr = Page.ClientScript;
String ContextID = "__gv" + GridView1.ID.ToString() + "__div";
String cbReference = scriptMgr.GetCallbackEventReference(this, "arg", "ReceiveServerData", ContextID);
String callbackScript = "function CallServer(arg,context) {"+ ContextID + ".innerHTML = 'Loading...;" + cbReference + ";}";
scriptMgr.RegisterClientScriptBlock(this.GetType() , "CallServer", callbackScript, true);
if (!Page.IsPostBack)
{
DataColumn dc1 = new DataColumn("EmpId", typeof(System.Int32));
DataColumn dc2 = new DataColumn("Name", typeof(System.String));
DataColumn dc3 = new DataColumn("Designation", typeof(System.String));
DataColumn dc4 = new DataColumn("Salary", typeof(System.Int32));
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
dt.Columns.Add(dc3);
dt.Columns.Add(dc4);
dt.Constraints.Add("PrimaryEmpID",dc1, true);
Session["empTable"] = dt;
}
}
please tell me how to maintain Session["empTable"] even after refresh hit??