Basically i am trying to set a session when a user clicks a specific button is this possible?
So i need to set this session
Session("TenHolStDateNewCheck") = "%"
When this link is clicked
<a href="availability.aspx" class="sidelink">blahblah</a>
thanks
Jamie
You need a server side code to set session, use $.ajax() function
Using jQuery with ASP.NET
You can use something like this:
Server side (C#)
public partial class _Default : Page
{
[WebMethod]
public static void SetSession()
{
...
}
}
Client side (aspx)
$.ajax({
type: "POST",
url: "Default.aspx/SetSession",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function() {
alert('SetSession executed.');
}
});
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