ASp.Net day

Micro blog

screen scrapping asp.net pages

January 22
by Satalaj 22. January 2010 10:19

  If you want to crawl asp.net pages using HttpWebRequest and HttpWebResponse, you need to POST the __VIEWSTATE, EVENTARGUMENT and EVENTTARGET
along with your Request. 
  If that page stores session or cookies you need to pass session cookies and Cookies along with the HttpWebRequest object.
You need to use Post Method.

 your post data will look like this

string postData = "__EVENTARGUMENT=" + value + "&_EVENTTARGET="+ targetValue+ "&__VIEWSTATE="+ViewState ;

You first use tools like fiddler to know how your broser post the data to .aspx pages then prepare your post string to post the data.


Satalaj

Tags:

Asp.net | General

Comments

Comments are closed

About Satalaj

My name is Satalaj. I'm 2010 asp.net MVP. I write technical stuff here. www.satalaj.com

Ads by Lake Quincy Media

The best inline translator

Live lookup to see what asp.net developers are searching