How to by-pass ASP.NET client-side validation to verify server-side validation
<p>I’m interested in identifying a means to verify the server-side validation is performing as expected, but need to bypass the client-side validation being done using ASP.NET validation controls. To test this, I’ve tried using the form Poster add-on to Firefox that allowed me to get/modify the page contents and post it, but the .NET framework interpreted the submission as harmful and threw an application error (“A potentially dangerous Request.Form value was detected from the client”).</p>

<p>I’ve created a WinForm that includes a WebBrowser control and I’m able to manipulate the contents of the web page and invoke the button click, but am interested in seeing how to allow a postback with invalid input values. I don’t want to assume the server-side validation works (even though I do check if Page.IsValid on the server on postback). Any suggestions would be appreciated.</p>

<p>This submits the web form in the WebBrowseer control and the expected client-side validation fires:
<code>extendedWebBrowser1.Document.GetElementById(formButtonName).InvokeMember("click");</code></p>

<p>This is how I’ve manipulated some of the page contents (this just prevents submission):
<code>mshtml.IHTMLDocument2 doc = extendedWebBrowser1.Document.DomDocument as mshtml.IHTMLDocument2;
string html = doc.body.innerHTML;
html.Replace("Page_ValidationActive = false", "Page_ValidationActive = true");
doc.body.innerHTML = html.ToString();
extendedWebBrowser1.Document.GetElementById(formButtonName).InvokeMember("click");</code></p>
