How to satisfy or bypass viewstate validation in Asp.net WebForms on separate post?

junkboy

New Member
I`ve got a link in a Webforms page which opens in a new window, and posts to a form other than the page itself. This is done like this:JS:\[code\]var submitFunc = function(){ document.forms[0].action = 'http://urlToPostTo/somePage.aspx'; document.forms[0].target = '_blank'; document.forms[0].submit();}\[/code\]The link:\[code\]<input type="hidden" id="myDataId" value="http://stackoverflow.com/questions/12690214/12345" /> <a href="javascript:submitFunc();">Search</a>\[/code\]As you can see, this overrides the target of the main \[code\]<form>\[/code\], and attempts to post to a different page. The whole point is that this should post/submit to a different page, while avoiding passing the data of "myDataId" as a Get parameter. The above code would work, but causes an error due to viewstate validation. Question: Is there any way for me to either satisfy the requirements here, or somehow bypass the viewstate validation so I can post my data this way?
 
Back
Top