Wednesday, 21 August 2013

Setting session value in aspx page

Setting session value in aspx page

I want to assign some value to a session variable via JavaScript in my
aspx page.
var name = e.object.text;
<%# Session["CurrentName"] = name %>
Above code is giving following error:
Compiler Error Message: CS0103: The name 'name' does not exist in the
current context
When I googled all the post are about getting the value from session in
JavaScript. But I want to set the value to a session variable in
JavaScript code.
How can I assign value to session variable in JavaScript?
Thank you

No comments:

Post a Comment