Skip to content

Instantly share code, notes, and snippets.

@jasonyost
Last active August 29, 2015 14:01
Show Gist options
  • Save jasonyost/454be8dfeb9fa094ba8b to your computer and use it in GitHub Desktop.
Save jasonyost/454be8dfeb9fa094ba8b to your computer and use it in GitHub Desktop.
ASP.NET jQuery POST exclude 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!");
}else{
jQuery("#poststatus").html("There has been an error while accepting your submission. Please contact us.");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment