Asp.Net Scrapping Grid Pages
- by SH
I need cod in C#.
Look, i am trying to post the search.aspx page which contains Asp.Net grid. When grid is rendered it loads very first page on the screen and then there are number of pages in the grid header.
I scrap first page, and now i want to move on to the next page. All this is being done using following code:
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://pubrec3.hillsclerk.com/oncore/search.aspx?" + param);
myRequest.Method = "GET";
myRequest.KeepAlive = false;
HttpWebResponse webresponse;
try
{
webresponse = (HttpWebResponse)myRequest.GetResponse();
Encoding enc = System.Text.Encoding.GetEncoding(1252);
StreamReader loResponseStream = new
StreamReader(webresponse.GetResponseStream(), enc);
string r = loResponseStream.ReadToEnd();
loResponseStream.Close();
webresponse.Close();
//if (GetRecordCount(r))
ExtractResultTable(bd, ed, r);
}
catch (Exception ex)
{
}
The above code grabs first page... and now i have to move on to the next page.
This is the link which produces a grid with 3 pages.
http://pubrec3.hillsclerk.com/oncore/search.aspx?bd=01/01/2008&ed=12/31/2008&bt=O&lb=1000000&ub=1000000000&d=5/6/2010&pt=-1&dt=D,%20MTG&st=consideration
Using above code i need to load the 2nd page with the same search criteria but the records found in 2nd page. and then so on.
I know there is a trick to navigate through the grid pages. I used it but it did not work on this page. the trick is, you can pass __EVENTTARGET and __EVENTARGUMENT in query string to navigate through the gird but it does not work on this website.
I am desperately searching a way, how to cope with this website. i really want this done. i do not want any code but a way to nevigate throgh the grid using query string if it does work.
Otherwise please be specific to the problem.