Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

If I have this Website link:

http://www.islamicfinder.org/prayer_service.php?country=bahrain&city=manama&state=02&zipcode=&latitude=26.2361&longitude=50.5831&timezone=3.00&HanfiShafi=1&pmethod=4&fajrTwilight1=&fajrTwilight2=&ishaTwilight=0&ishaInterval=0&dhuhrInterval=1&maghribInterval=1&dayLight=0&simpleFormat=xml


How can I read values from that page into my aspx page?
For example I want only the first two timings.
Any help please?
Posted

You can try this
private string GetHtmlFromUrl(string url)
        {
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);

            using (Stream stream = request.GetResponse().GetResponseStream())
            {
                using (StreamReader reader = new StreamReader(stream))
                {
                    string response = reader.ReadToEnd();
                    return response;
                }
            }
        }


Please vote and Accept Answer if it Helped.
 
Share this answer
 
v2
Comments
Nish Nishant 4-Nov-10 10:54am    
Voted 5!
shakil0304003 4-Nov-10 11:43am    
thanks
string value = Request.QueryString["parameterName"];
 
Share this answer
 
Comments
batool ahmed 4-Nov-10 9:19am    
But its a remote URL, how can I tell my page to read from it?
Define "remote". If you have control over both sites:

0) You can have the "remote" site send the query string to another web page that can perform whatever processing you might require

1) Yu can save the query string to a database shared with another web site that can periodically request rceent data.

If you don't have control over the remote site, you're pretty much out of luck.
 
Share this answer
 
You need to get the HTML for that page (as Shakil posted above), and then parse out the required data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900