How do i get the innerhtml of any of the .aspx file in any of the .cs file using C# asp.net

Posted by Mahe under C# on 7/24/2012 | Points: 10 | Views : 2343 | Status : [Member] | Replies : 1
Hi,

How do i get the innerhtml of any of the .aspx file in any of the .cs file using C# asp.net

Regards,
Mahe




Responses

Posted by: Ranjeet_8 on: 7/25/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
using System.IO;

using System.Net;

    public static String code()

{

HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.google.com"); // Your ASPX Page URL
myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
string result = sr.ReadToEnd();
sr.Close();
myResponse.Close();

return result;
}


Mahe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response