Solved

c# show the output of a virtual path?

Posted on 2011-02-21
2
477 Views
Last Modified: 2013-12-17
hi all,

im trying to find out the exact url of <%@ PreviousPageType VirtualPath="~/Companies/test.aspx"  %>

how can i output the above in path format, i.e
i want it to show where that leads. http://website.com/Companes/test.aspx

i need to know what the ~ path is from this page

Thanks

0
Comment
Question by:awilderbeast
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 34942468
The tilda just means "from site root" so will only give you a relative path even when resolved. If you want the full path then you will need to strip the domain information from the Request object.
string path = "~/Companies/test.aspx";
string url = string.Format("{0}://{1}{2}",
                         Request.Url.Scheme,
                         Request.Url.Authority,
                         ResolveUrl(path));

Open in new window

0
 
LVL 1

Author Closing Comment

by:awilderbeast
ID: 34942512
thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question