PathInfo And ASP.NET Themes: Why Can’t They Work Together?

If you ever worked with ASP.NET Themes and Skins, you know that stylesheet links are added to the head section of the HTML document.

The rendered URL to these stylesheets is always relative to location of the page being requested.

So, for a request to:

http://MySite/Section/Default.aspx

you'll get:

<link href="../App_Themes/Default/Styles.css" type="text/css" rel="stylesheet" />

which will make the web browser request for:

http://MySite/App_Themes/Default/Styles.css

and it all works fine.

Well, it works fine until you need to navigate to:

http://MySite/Section/Default.aspx/PathInfo

You'll get the same stylesheet reference and the browser will request for:

http://MySite/Section/Default.aspx/App_Themes/Default/Styles.css

This happens because the web browser has no knowledge of what PathInfos are. It only accounts for the number of forward slashes (/).

I've filed a bug on Microsoft Connect about this.

Published Wednesday, July 23, 2008 11:37 PM by Paulo Morgado
Filed under: , , , , ,

Comments

Wednesday, July 23, 2008 7:13 PM by Paulo Morgado

# Making PathInfo And ASP.NET Themes Work Together

On my last post I wrote about the problem that arises when we try the use path infos and ASP.NET Themes

Wednesday, July 23, 2008 7:13 PM by Paulo Morgado

# Making PathInfo And ASP.NET Themes Work Together

On my last post I wrote about the problem that arises when we try the use path infos and ASP.NET Themes

Friday, July 25, 2008 4:13 AM by Cristovao Morgado

# re: PathInfo And ASP.NET Themes: Why Can’t They Work Together?

That's strange, I've used it all the time and never had problems.

The issue arises when you have webapplication inside webaplications i guess,

I've just build one webapplication with + 50 pages with alot of sub dirs and it works.

/

/Customer

/Apps

/Apps/PrivateToolkit

/Apps/PrivateToolkit/CommercialAction

/Apps/PrivateToolkit/WorkQueues

Friday, July 25, 2008 8:11 AM by Paulo Morgado

# re: PathInfo And ASP.NET Themes: Why Can’t They Work Together?

It's not about the depth or the number of sub dirs or number of pages.

It's about PathInfo (msdn.microsoft.com/.../System.Web.HttpRequest.PathInfo.aspx) and the difference of the perceived depth between the client and the server.

Thursday, July 31, 2008 7:48 PM by Paulo Morgado

# Other Ways For Making PathInfo And ASP.NET Themes Work Together

On my last post I wrote about a solution for the problem that arises when we try the use path infos and

Leave a Comment

(required) 
(required) 
(optional)
(required)