Monday, August 10, 2009

Getting HTML from another page(aspx page)

string html;
string newurl = "http://localhost:1997/testpage.aspx";

WebClient c = new WebClient();
Stream s = c.OpenRead(new Uri(newurl));
StreamReader reader = new StreamReader(s);
html = reader.ReadToEnd();
reader.Close();
divid.InnerHtml = html; //This is div id

No comments:

Post a Comment