D
daveh551
I need some help (and my apologies if this is not the right group)
understanding how to properly form Relative URL's.
I'm developing a site (Web Site, not a Web Application if that makes a
difference) in VS 2005. The application is called OBS, and it's
located C:\Inetpub\wwwroot\OBS. In IIS, it shows a Virtual Directory
at that location, running an application "OBS", and with a Starting
point "<Default Web Site>\OBS".
When I specify relative URLs in links and Response.Redirect calls,
I've been specifying it as "~/PageName.aspx", or whatever. Most of
the time that works, but sometimes I will get a 404 Resource not found
error saying that it could not locate the resource "/OBS/~/
PageName.aspx" I was under the impression that the "~" stood for the
root, i.e., OBS. So why is it constructing the resource name that
way?
Also, I thought that "/PageName.aspx" should be equivalent to "~/
PageName.aspx", but it clearly is not, since that fails almost all the
time.
In one case (which seems to have stopped working that way now, for
some unknown reason), the Redirect worked correctly when it was run
from the Default page, but when it was run from a different page
(still at the top level), it failed in the above manner.
I seem to be able to get it work if I put the link in as
"PageName.aspx", but I know that will break if I end up moving pages
around to different directories, so I want to avoid that .
Can anyone tell me anything that will shed some light on my obvious
confusion?
Thanks in advance for any help.
understanding how to properly form Relative URL's.
I'm developing a site (Web Site, not a Web Application if that makes a
difference) in VS 2005. The application is called OBS, and it's
located C:\Inetpub\wwwroot\OBS. In IIS, it shows a Virtual Directory
at that location, running an application "OBS", and with a Starting
point "<Default Web Site>\OBS".
When I specify relative URLs in links and Response.Redirect calls,
I've been specifying it as "~/PageName.aspx", or whatever. Most of
the time that works, but sometimes I will get a 404 Resource not found
error saying that it could not locate the resource "/OBS/~/
PageName.aspx" I was under the impression that the "~" stood for the
root, i.e., OBS. So why is it constructing the resource name that
way?
Also, I thought that "/PageName.aspx" should be equivalent to "~/
PageName.aspx", but it clearly is not, since that fails almost all the
time.
In one case (which seems to have stopped working that way now, for
some unknown reason), the Redirect worked correctly when it was run
from the Default page, but when it was run from a different page
(still at the top level), it failed in the above manner.
I seem to be able to get it work if I put the link in as
"PageName.aspx", but I know that will break if I end up moving pages
around to different directories, so I want to avoid that .
Can anyone tell me anything that will shed some light on my obvious
confusion?
Thanks in advance for any help.