It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Assigning value to a Session variable in Javascript

Assigning value to a Session variable in Javascript

Postby sarfraz909 on Wed May 26, 2010 10:57 am

Hello there,

I have got a textbox (txtTemp) on my page. I want to put this textbox value in a session variable in javascript

I have tried the following in javascript:
function SetSessionVariable()
{
var temp = document.getElementById('<%=txtTemp.ClientID%>').value;
<%Session["TempVar"]="+ temp +";%>;
}

After this, I put the session variable value back in txtTemp in code like following:
this.txtTemp.Text = System.Web.HttpContext.Current.Session["TempVar"];
But the textbox shows: + temp +
instead of the value in the temp variable.
sarfraz909
 
Posts: 1
Joined: Wed May 26, 2010 10:32 am

Who is online

Users browsing this forum: No registered users and 3 guests