POST ASP.NET form with jQuery excluding the ViewState
// POST all the datas! except the ViewState
jQuery.post('https://www.example.com', jQuery("#form :not(#__VIEWSTATE) > :input").serialize() ,function(data,status){
if(data[0]["Status"] == "Success"){
jQuery("#poststatus").html("Thank you!");
//alert('Thank you for registering!');
}else{
jQuery("#poststatus").html("There has been an error while accepting your submission. Please contact us.");
//alert('There was an error while accepting your submission. Please contact us.');
}
});
Written by Jason Yost
Related protips
2 Responses
This grabs the form tag created by ASP.NET and serializes all fields except for the ViewState, it then POSTs that data to the URL of your choosing.
Make sure to change the data array to grab the appropriate value for a successful submission.
over 1 year ago
·
great one thank you !
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#