Quantcast
Channel: ASPSnippets RSS Feed
Viewing all articles
Browse latest Browse all 4693

Set Session variable in JavaScript in ASP.Net

$
0
0
Here Mudassar Ahmed Khan has explained with an example, how to set Session variable in JavaScript in ASP.Net using C# and VB.Net. JavaScript is a Client Side language and hence directly it is not possible to set Session variable in JavaScript. Thus, the solution is to make an AJAX call using XmlHttpRequest (XHR) and pass the value of JavaScript variable to a WebMethod and inside the WebMethod the value will be set in Session variable in ASP.Net using C# and VB.Net.

Viewing all articles
Browse latest Browse all 4693

Trending Articles