include asp page in webform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dune

    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 :)
  • Dino Chiesa [Microsoft]

    #2
    Re: include asp page in webform

    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.WebR equest req= System.Net.WebR equest.Create(u rlspec);
    System.IO.Strea mReader sr = new
    System.IO.Strea mReader(req.Get Response().GetR esponseStream() );
    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" <Dune@paradise. co.nz> wrote in message
    news:0bbc01c392 03$d9e86870$a30 1280a@phx.gbl.. .[color=blue]
    > 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 :)[/color]


    Comment

    Working...