I just wanted to fetch some useful data from a webpage. This webpage is using asp.net with UpdatePanel. When I do it manually, it takes me to follow to steps to get the required data. In the first step, I fill a TextBox with a search value and click a button. Then the webpage displays result with some values binded in it within a GridView. This GridView contains a View LinkButton that when clicked, displays the complete required information. I need to store this data for some other project. The website does not provide any kind of web service to do this and fetching this data is very important for my upcoming project otherwise the project will be cancelled.
I have tried various example that I have found while searching on StackOverflow, but it is returning me the first page with blank response data.
using (var wb = new WebClient())
{
var data = new NameValueCollection();
data["name"] = name;
var response = wb.UploadValues(url, "POST", data);
string value = ASCIIEncoding.ASCII.GetString(response);
lblResponse.Text = value;
}
Please guide me to do this important task.