store value in session
i want store a data in session at the time of button click and use these value at pageload
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Joginder BangerPosted Nov 10, 2014, 12:35 AM
https://github.com/AlexChittock/JQuery-Session-Plugin/blob/master/jquery.session.js
save this jquery in your local drive and after then reference it on you respective page.
Joginder BangerPosted Nov 10, 2014, 12:32 AM
but you can try
$.session.set("userName", $("#uname").val());
for more information check this link
http://stackoverflow.com/questions/15510590/how-to-get-value-in-the-session-in-jquery
muthukumarPosted Nov 10, 2014, 12:18 AM
when user click a button a value is assigned to session
2.when refresh a page it retrieve the value from session
muthukumarPosted Nov 10, 2014, 12:17 AM
when user click a button a value is assigned to session
2.when refresh a page it retrieve the value from session
Riddhi ValechaPosted Nov 10, 2014, 12:08 AM
This is possible if there are 2 webpages.
Eg-
Webpage - 1
Button1_Click
{
Session["Value"] = "abcd";
Response.Redirect("~/WebPage-2",false);
}
-----
Webpage - 2
Page_Load
{
Label1.text = Session["Value"].ToString();
}
-----------------
Are there 2 web pages or just 1 ??
Joginder BangerPosted Nov 10, 2014, 12:08 AM
private void Page_PreInit(object sender, System.EventArgs e)
{ if ((Session == null)) { // Do something here } }