Work on Asp.Net C# VS08 I would like to assign a value to Session using javascript. Is it possible?
example: Session["Id"] = document.getElementById("id").value;
The session is a server-side concept; Javascript has no conception of it.
You can make an AJAX service that sets a session value.
However, you should probably use a cookie instead.
You can set cookies in Javascript using this library, among others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With