This is a quick and dirty app that only needs to work for a short period. I'm not a developer so please don't hammer me. The following code in asp works fine (secret info replaced with example.com and abc 123).
I know the below is very bad practice, but this is just for demonstration purpose:
<form method="post" action="https://example.com/asppage.aspx" id="frm_main">
<input type="hidden" name="STATE" id="STATE" value="ABC" />
<input type="hidden" name="VALIDATION" id="VALIDATION" value="123/>
<input type="submit" name="refresh_progress" value="Check Status" id="refresh_progress" /></form>
However, the same code in my c# post doesn't work:
string PostData = "STATE=ABC&VALIDATION=123";
webBrowser1.Navigate("https://example.com/asppage.aspx", "_blank", Encoding.Default.GetBytes(PostData), "Content-Type: application/x-www-form-urlencoded\n\r");
When the new browser window pops up, its the default asppage.aspx form with no data posted to it.
Any ideas what I'm doing wrong?