473,411 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Get the full URL for a page

Hi there,
how do I get the full path for an .ASPX page? I thought the
ResolveURL would do it, but it only seems to return the page name with a
forward slash at the start. I need to send the full external path to remote
users so that they can run the page.

Jan 2 '08 #1
4 2805
"Waldy" <so*****@microsoft.comwrote in message
news:ey**************@TK2MSFTNGP05.phx.gbl...
how do I get the full path for an .ASPX page? I thought the ResolveURL
would do it, but it only seems to return the page name with a forward
slash at the start. I need to send the full external path to remote users
so that they can run the page.
Request.Url.AbsoluteUri
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 2 '08 #2
Hi Mark,
thanks for that, but I need the path to another page, not the
current one.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:Ow**************@TK2MSFTNGP03.phx.gbl...
"Waldy" <so*****@microsoft.comwrote in message
news:ey**************@TK2MSFTNGP05.phx.gbl...
>how do I get the full path for an .ASPX page? I thought the ResolveURL
would do it, but it only seems to return the page name with a forward
slash at the start. I need to send the full external path to remote
users so that they can run the page.

Request.Url.AbsoluteUri
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 2 '08 #3
"Waldy" <so*****@microsoft.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
thanks for that, but I need the path to another page, not the current one.
You should have said so...

string strRelativePath = "home/default.aspx"; // amend as necessary
Uri objUri = new Uri(Request.Url.GetLeftPart(UriPartial.Authority) + "/" +
Request.Url.Segments[1] + strRelativePath);
string strAbsoluteUri = objUri.AbsoluteUri;
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 2 '08 #4
Hi Mark,
thanks for that. I was hoping that there was a function for
it. I did this in the end as your code didn't work for me:

String FullURL = Request.Url.AbsoluteUri.Substring(1,
Request.Url.AbsoluteUri.Length - Request.Path.Length);
FullURL += "MyOtherPage.aspx";
Jan 7 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Don | last post by:
How do I retrieve the full path (C:\.....filename) of a file uploaded to a php script on the server. I think $_FILES will only provide 'name', which is only the filename itself. Thanks, Don ...
7
by: Travis Pupkin | last post by:
Hi, Just curious: is there a bit of ASP code you can place in the top of a document that will force all root relative image and file paths in the HTML of this doc to expand to include the full...
13
by: CJM | last post by:
I am building several (common) db-driven intranet sites (so I cant post URL), using a 3-frame layout; header, menu & main pages. The styling and some of the positioning is done via CSS. Up until...
1
by: onewebclick | last post by:
Is there a way to detect a browser cache is full using javascript or HTML thorugh a web page and inform the user to clear the cache to improve performance of the website. It looks like google's...
2
by: jeffrey.bigham | last post by:
Hello, I'm developing an application in C# using the WebBrowser control and need to toggle images off and on. After some digging, I found the appropriate registry key that needs to be set and...
3
by: Vibhu | last post by:
Hello All, I have a input box on the HTML page with the type set to file. What I want is that when the value changes in the file textbox, it should give me the full file path. I have even tried...
4
by: BLIZZARDICE | last post by:
I will discribe my problem here but the second paragraph will discribe my setup. I have been working on a project in house and we thouhgt we were ready to move it outside for the client. However...
3
by: Eric | last post by:
I'm currently building a small application that needs to fully edit an HTML page. I had stopped my choice on a control on the FreeTextBox editor and started to work with it. However, I found...
0
by: Hetal | last post by:
We recently upgraded to VS 2008 and for some reason, the environment does not show "Start Page" in full screen mode even when setting in Environment -Startup is set to "Show Start Page". It does...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.