Mar 22, 2007 11:26 AM|jminond|LINK
When you scrape the page, you are inlcuding the entire html in your aspx page?
Why not do a regex or string part, and take only the form? and write that out to your aspx page?
Are you clearing the response on your aspx page, and replacing with what you scrape? If thats the case, the the form would submit to it's original intended target, unless the action is relative path, in which case you still have to play with the scrape,
and correct the action to post to where you want.
Something along the lines of getting just the html you want from the screen scrape:
string pollHTMLForm = string.Empty;
Regex regex = new Regex("<div id='polldiv'>((.|\n)*?)</div>", RegexOptions.IgnoreCase);
using (WebClient httpRequest = new WebClient())
httpRequest.UseDefaultCredentials = true;
string strContent = httpRequest.DownloadString(URL);
Match oM = regExToMatch.Match(strContent);
pollHTMLForm = oM.Value;