Get full url from relative url

Discussion in 'ASP .Net Web Controls' started by David Thielen, May 25, 2006.

  1. David Thielen, May 25, 2006
    #1
    1. Advertisements

  2. Hi David,

    Thank you for post!

    For the "/portal/report.aspx" part, we can use "Page.ResolveUrl" to get it:

    Page.ResolveUrl("~/report.aspx")

    Normally this part is enough for page navigation. If you need to get the
    "http://server" part, you can use "Request.Url" to construct it:

    Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port

    Hope this helps. If there's anything unclear, please feel free to post here.

    Regards,
    Walter Wang
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], May 26, 2006
    #2
    1. Advertisements

  3. That does it. I'm surprised there is not a single call to give the full url
    (we use it when in a page they cause an email to be sent with a url to the
    site).
     
    David Thielen, May 26, 2006
    #3
    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.