469,586 Members | 2,187 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,586 developers. It's quick & easy.

include asp page in webform

I'm trying to migrate a page as quickly as possible from
asp to asp .net and was wondering if there is any way to
include an asp page in an aspx page? Basically, I'd like
to be able to do something equivalent to "<!-- #include
file="SomeFile.asp" -->" in a webform.

cheers :)
Jul 21 '05 #1
1 4693
It is possible to "call" external web pages from asp.net, regardless of
whether those pages are in ASP.NET, PHP, CFM, JSP, ASP, or whatever. It's
all just
HTTP.

If the returned web page is formatted as XML, you can then parse the XML (or
deserialize it).
if it is HTML, you can display it or parse it,
etc.

It's up to you.

for a GET, you would do something like this:
string urlspec= "http://www.google.com";
System.Net.WebRequest req= System.Net.WebRequest.Create(urlspec);
System.IO.StreamReader sr = new
System.IO.StreamReader(req.GetResponse().GetRespon seStream());
result= sr.ReadToEnd ();

The result would then hold the raw HTML. If you wanted to invoke a local
page, you could use http://localhost/aspdir/whatever.asp as your urlspec.

For a POST the code is somewhat different but the principle is the same.

--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ o n l i n e . m i c r o s o f t . c o m
"Dune" <Du**@paradise.co.nz> wrote in message
news:0b****************************@phx.gbl...
I'm trying to migrate a page as quickly as possible from
asp to asp .net and was wondering if there is any way to
include an asp page in an aspx page? Basically, I'd like
to be able to do something equivalent to "<!-- #include
file="SomeFile.asp" -->" in a webform.

cheers :)

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Quentin | last post: by
6 posts views Thread by dave | last post: by
4 posts views Thread by Keith Chadwick | last post: by
4 posts views Thread by Andrea Williams | last post: by
5 posts views Thread by Benjamin Bittner | last post: by
5 posts views Thread by NuB | last post: by
1 post views Thread by Dune | last post: by
4 posts views Thread by Goran Djuranovic | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.