Accessing & Assigning the Session Variable using Javascript:
Assigning the ASP.NET Session Variable using Javascript:
<script type="text/javascript"> function SetUserName() { var userName = "Shekhar Shete"; '<%Session["UserName"] = "' + userName + '"; %>'; alert('<%=Session["UserName"] %>'); } </script>
Accessing ASP.NET Session variable using Javascript:
<script type="text/javascript"> function GetUserName() { var username = '<%= Session["UserName"] %>'; alert(username ); } </script>
Hope this helped you…! 🙂
sir when i am using your code i am getting following error.
The Controls collection cannot be modified because the control contains code blocks (i.e. ).
Sir, related to this topic my functionality is there so reply as soon as possible……
Thanks that was helpful var username = ”; works
Wel-come..:)
Greate
solve my issue
Thanks
Wel-come.. 🙂