How to get HTML from a relative URL? WebRequest, WebResponse won't work in my case

Discussion in 'ASP .Net' started by John, Mar 3, 2005.

  1. John

    John Guest

    I am in need to find a way to get the HTML from an internal URL.
    For example: I have page : default.aspx?page=Test, I need to get HTML of
    that page after rendering.

    At first thought, I would use WebRequest to make a requestion, then use
    WebResponse to get the HTML. However, it won't work in my situation.
    The resaon for that is:
    WebRequestion needs a URI, which is in the format of
    http://<MyDomainName>/deafult.aspx?page=Test ...
    In my particular situation, the web server does not recogonize MyDomainName
    (an external domain name), so if I put:
    Dim req As WebRequest =
    WebRequest.Create("http://MyDomainName/Default.aspx?page=Test") , error will
    occur.

    Is there any way to achieve what WebRequest and WebResponse can achieve, but
    requires a relative URL?
    Thanks
     
    John, Mar 3, 2005
    #1
    1. Advertisements

  2. John

    Joerg Jooss Guest

    Can't you use localhost or an IP address?

    Cheers,
     
    Joerg Jooss, Mar 5, 2005
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.