Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set asp.net Session variables via javascript 1

Status
Not open for further replies.

JonathanHerschel

Programmer
Mar 29, 2007
33
US
Ok, I know that you may be thinking that since Session variables are server side and js is client script, you couldn't set the Session variables for the present page, but I don't need them until the next page.

I've searched and only found that this 'can't be done'.
There has to be a workaround. I have a <div> tag that is hidden/shown via javascript, but I would like to keep this setting through the whole session.

In my ASP.Net project I set Session["div"] = hide, but I would like that when the tag is hidden/shown(via js onclick), I can update the Session variable. Does anyone have any workarounds up their sleeve?

thanks,
Jonathan
 
Hi

Jonathan said:
Set asp.net Session variables via javascript
That would be a nice vulnerability. Fortunately indeed 'can't be done'.

The best you can do is to send the value with AJAX to an ASP anything.

Or even more simple, store it in a cookie.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top