I am trying to start submitting a form via jQuery and have a special fire on the server side.
Client Code:
$("input[name=__EVENTARGUMENT]").val("SomeArg");
form = $("body form");
form.submit();
Server Code:
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
if (Request["__EVENTARGUMENT"] == "SomeArg")
{
}
}
}
The problem is that the hidden input "__EVENTARGUMENT" does not exist. I found that if I add an ASP.NET server management dropdown with autopostback = true, EVENTARGUMENT hidden input will be created. Is there a cleaner way to get ASP.net to create these hidden inputs and let me get their values on the server side without adding controls that I really don't need on the page?
source
share