ASP.NET 2.0: RewritePath breaks HyperLink's ImageUrl in App_Theme file when path with slash is rewritten

28. October 2007

Rewriting a path with a slash ("/") in it will cause a HyperLink's image specified in the ImageUrl property within an App_Theme file to not be displayed. This can also lead to a "Cannot use a leading ..." error when running the website within IIS.

Here's a screenshot of the issue occuring:

 

This is kind of a strange bug, since doing the same thing with an Image works just fine. It's only the HyperLink that breaks. I experienced this issue the other day, and it took me a little bit to figure out what was causing the problem. The answer is ASP.NET, kind of.

Download Code: ASPNETRewritePathHyperLinkBug.zip (3.28 kb)

asp.net ,

Comments

Aaron
Aaron
11/15/2007 2:19:00 AM #
I'm having the same issue! Everything was working well... I added a rewrite rule for my page and bam! I got the error: "Cannot use a leading .. to exit above the top directory.". It took me a little while to track it down to the ImageUrl of HyperLink while other images worked fine. Lame.