Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin



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

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 Sample Code Demonstrating this issue here.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: asp.net | General
Posted by crpietschmann on Sunday, October 28, 2007 1:08 AM
Permalink | Comments (1) | Post RSSRSS comment feed

Related posts

Comments

Aaron

Wednesday, November 14, 2007 10:19 PM

Aaron

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.

Comments are closed

About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann