sarfraz909
Programmer
Hello everyone,
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 = (string)System.Web.HttpContext.Current.Session["TempVar"];
But the textbox shows: + temp +
instead of the value in the temp variable.
Thanks...
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 = (string)System.Web.HttpContext.Current.Session["TempVar"];
But the textbox shows: + temp +
instead of the value in the temp variable.
Thanks...