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(objec t sender, EventArgs e)
{
ClientScriptMan ager scriptMgr = Page.ClientScri pt;
String ContextID = "__gv" + GridView1.ID.To String() + "__div";
String cbReference = scriptMgr.GetCa llbackEventRefe rence(this, "arg", "ReceiveServerD ata", ContextID);
String callbackScript = "function CallServer(arg, context) {"+ ContextID + ".innerHTML = 'Loading...;" + cbReference + ";}";
scriptMgr.Regis terClientScript Block(this.GetT ype(), "CallServer ", callbackScript, true);
if (!Page.IsPostBa ck)
{
DataColumn dc1 = new DataColumn("Emp Id", typeof(System.I nt32));
DataColumn dc2 = new DataColumn("Nam e", typeof(System.S tring));
DataColumn dc3 = new DataColumn("Des ignation", typeof(System.S tring));
DataColumn dc4 = new DataColumn("Sal ary", typeof(System.I nt32));
dt.Columns.Add( dc1);
dt.Columns.Add( dc2);
dt.Columns.Add( dc3);
dt.Columns.Add( dc4);
dt.Constraints. Add("PrimaryEmp ID",dc1, true);
Session["empTable"] = dt;
}
}
please tell me how to maintain Session["empTable"] even after refresh hit??
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(objec t sender, EventArgs e)
{
ClientScriptMan ager scriptMgr = Page.ClientScri pt;
String ContextID = "__gv" + GridView1.ID.To String() + "__div";
String cbReference = scriptMgr.GetCa llbackEventRefe rence(this, "arg", "ReceiveServerD ata", ContextID);
String callbackScript = "function CallServer(arg, context) {"+ ContextID + ".innerHTML = 'Loading...;" + cbReference + ";}";
scriptMgr.Regis terClientScript Block(this.GetT ype(), "CallServer ", callbackScript, true);
if (!Page.IsPostBa ck)
{
DataColumn dc1 = new DataColumn("Emp Id", typeof(System.I nt32));
DataColumn dc2 = new DataColumn("Nam e", typeof(System.S tring));
DataColumn dc3 = new DataColumn("Des ignation", typeof(System.S tring));
DataColumn dc4 = new DataColumn("Sal ary", typeof(System.I nt32));
dt.Columns.Add( dc1);
dt.Columns.Add( dc2);
dt.Columns.Add( dc3);
dt.Columns.Add( dc4);
dt.Constraints. Add("PrimaryEmp ID",dc1, true);
Session["empTable"] = dt;
}
}
please tell me how to maintain Session["empTable"] even after refresh hit??
Comment