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:
var submitFunc = function(){
document.forms[0].action = 'http://urlToPostTo/somePage.aspx';
document.forms[0].target = '_blank';
document.forms[0].submit();
}
The link:
<input type="hidden" id="myDataId" value="12345" />
<a href="javascript:submitFunc();">Search</a>
As you can see, this overrides the target of the main <form>
, 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?