Initiating a new Request mid-page?

P

pmccombs

I have a situation where I am migrating some ASP pages to ASP.NET. A
particular page that I have migrated #includes another ASP page that is
not going to be migrated. This is unforunate because it causes the two
pages to be "mixed" together, resulting in a part of the page that
needs to be processed with the ASP filter, and another part that needs
to be processed by ASP.NET.

Is there a way that I can initiate a new server request during the
ASP.NET processing, obtain the HTML result of the new request (using
the ASP page), and then render that result into the original ASP.NET
request?

I've heard of 3rd party "bridge" software that can do this, but that is
really not an option with my project. I'm hoping there is a fairly
simple way to do it, otherwise I will have to convert all of the ASP to
ASP.NET.
 
S

souri challa

You can use System.Net.HttpWebRequest or System.Net.WebClient to access
the ASP page.
Here is code snippet

private string GetContent(string url)
{
HttpWebRequest oReq = (HttpWebRequest)HttpWebRequest.Create(url);

HttpWebResponse oResponse = (HttpWebResponse)oReq.GetResponse();
StreamReader sr = new StreamReader(oResponse.GetResponseStream());
string content = sr.ReadToEnd();
sr.Close();
return content;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top