Get full url from relative url

W

Walter Wang [MSFT]

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.
 
D

David Thielen

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).
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top