Click here to Skip to main content
15,907,396 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can any one tell me, How to convert a page file path to http url?

If I pass the path below
/TempFolder/WebForm.aspx

then it should return
http://www.abc.come/TempFolder/WebForm.aspx
Posted
Updated 14-Oct-10 21:36pm
Comments
Dalek Dave 15-Oct-10 3:36am    
Minor Edit for Grammar.

Clearly your question is not complete. You are in a certain scenario where you get relative path and you want to have absolute path to use.
Posting complete scenario would always help you in getting proper and exact replies.

For now, as it looks like, you are having relative path. Use Uri.Absolute path to get the complete path.
If needed, you can use any known file and it's path to get the full path.
Even a Request/Response would have a complete Url. Try!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 15-Mar-11 21:57pm    
Correct, my 5.
--SA
 
Share this answer
 
I think you can do this, simply. Like
<a href="TempFolder/WebForm.aspx">Home</a>
<a href="~/TempFolder/WebForm.aspx" id="aDefault" runat="server"></a>

so, if the link is runat="server" then you have to use relative path.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900