get html from csharp file

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
Hi Guys
I am in a critical task
I need to get the html of a page
private static string GetPageContent(string FullUri ,ref CookieContainer Cookies)<br/>
{<br/>
HttpWebRequest Request;<br/>
StreamReader ResponseReader;<br/>
Request = ((HttpWebRequest)(WebRequest.Create( FullUri )));<br/>
Request.CookieContainer = Cookies;<br/>
ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());<br/>
return ResponseReader.ReadToEnd();<br/>
}

Above is the code i tried by passing the FullUri as "http://localhost/myproject/ demo.aspx ?ID=" +ID
Above is the sample url so when it goes it is directly doing to login page and getting html of login page but i need
demo.aspx html page
In our application there is authentication problem
so is there any way to get the html of a page with out using the url type and render from aspx.cs file before it renders to the page
Any Idea
So if there is any solution please guide me
so that i can show this to client
Karthik.K



View the full article
 
Back
Top