Having an issue with my asp.net 3.5 app. Whenever I try to add a value to the URL for Request.PathInfo
, it seems like I lose all connections in the head
section because the paths are resolved as relative.
This is how the master page appears:
<head id="Head1" runat="server">
<link rel="stylesheet" href='~/App_Themes/main/style.css' type="text/css" />
</head>
After rendering, it looks like this:
<head id="ctl00_ctl00_Head1">
<link rel="stylesheet" href="../App_Themes/main/style.css" type="text/css" />
</head>
When I visit
http://localhost:5000/project/folder/edit.aspx/555
The browser searches for the stylesheet at
http://localhost:5000/project/folder/App_Themes/main/style.css
Instead of
http://localhost:5000/project/App_Themes/main/style.css
Is this automatic behavior to resolve with a relative path? Can I modify it? Could this be something that the previous developer implemented and I haven't discovered yet?
--- edit ---
I followed the suggestion below and included a base
element like this
<base id="ctl00_ctl00_baseElement" href="http://localhost:5000/project/"></base>
However, my links still aren't functioning properly because asp.net always renders the URLs as relative paths unless the href
starts with /
. In both cases, I end up one level too high now.
http://localhost:5000/App_Themes/main/style.css