0
Answer

Remove PageDirective,Meta tags, Title,Head,Body from an Http Page

Hi, I am using asp.net 2.0.

I create webappln1.aspx and  I am using a Hidden field variable in the asp.net page and assigning some value to it.

I create another web appln2 and call the url of webappln1.aspx using the HttpWebRequest and HttpWebResponse.

A sample of the code is posted below.

string lcUrl = "http://localhost:2018/WebAppn1/Default.aspx";

// *** Establish the request

HttpWebRequest loHttp = (HttpWebRequest)WebRequest.Create(lcUrl);

// *** Retrieve request info headers

HttpWebResponse loWebResponse = (HttpWebResponse)loHttp.GetResponse();

Encoding enc = Encoding.GetEncoding(1252); // Windows default Code Page

StreamReader loResponseStream = new StreamReader(loWebResponse.GetResponseStream(), enc);

string lcHtml = loResponseStream.ReadToEnd();

loWebResponse.Close();

loResponseStream.Close();

I do not want any HttpHeader Info like Page directive, html info, meta tags, body info.

I just want to extract the value in the Hidden field of WebAppln1.aspx. That's all.

Will somebody help me out at the earliest? It's urgent.

krishna