Windows Azure Platform Developer Center >
Microsoft Visual Studio 2010 Beta 2 Forums
>
Windows Azure
>
Request.URI
Request.URI
- Hi,
Need confirmation if Request.Url.AbsolutePath will work in Azure to get the URL of the page.
Thanks, Sonia
Answers
- Hi Sonia,
You can get the Page name in a number of ways. For me often the best way is Request.RawUrl (as Yi-Lun said before)
Request.RawUrl will give you the full path:
http://www.mywebsite.com/virtualDirectory/index.aspxthe raw URL is
/virtualDirectory/index.aspx- Marked As Answer bySonia Bansal Thursday, November 05, 2009 3:24 AM
- For the file name, you can use Request.FilePath if the URL is http://www.mywebsite.com/virtualDirectory/index.aspx the file path property is /index.aspx so you will to remove back slash
- Edited byTzafrirben Wednesday, November 04, 2009 2:22 PMLooks bad with no new line
- Marked As Answer bySonia Bansal Thursday, November 05, 2009 3:24 AM
All Replies
Hi,
I don't see a reason that it would not work ;)
But I can test in a jiffy and let you know for sure.- Hello, until the port number issue is fixed, Request.Url.AbsolutePath will give a wrong port. To get the actual port number, please use:
"http(s)://" + Request.Headers["Host"] + Request.RawUrl
Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights. - Hi Yi-Lun-Lo,
I am only concerned with the PageName, so I think that will work perfectly in Azure?
Thanks, Sonia - Hi Sonia,
You can get the Page name in a number of ways. For me often the best way is Request.RawUrl (as Yi-Lun said before)
Request.RawUrl will give you the full path:
http://www.mywebsite.com/virtualDirectory/index.aspxthe raw URL is
/virtualDirectory/index.aspx- Marked As Answer bySonia Bansal Thursday, November 05, 2009 3:24 AM
- Thanks for all your suggestions.
Thanks, Sonia - For the file name, you can use Request.FilePath if the URL is http://www.mywebsite.com/virtualDirectory/index.aspx the file path property is /index.aspx so you will to remove back slash
- Edited byTzafrirben Wednesday, November 04, 2009 2:22 PMLooks bad with no new line
- Marked As Answer bySonia Bansal Thursday, November 05, 2009 3:24 AM
Thanks :)
Thanks, Sonia


