Using the FileResolver to allow virtual application paths ( ~ ) in any file

Bobby DeRosa has solved one of the pesky thing I had with ~ in virtual paths, the fact that you can’t use it on a asp.net page or control.

Now great I can write a relative link to a background image in a CSS file without worrying about the level of the page calling the stylesheet.

something like background: #ccc url(~/i/myImage.gif.ashx) 20px 17px;

Notice the ashx extension to call the FileResolver module

 

1 Comment

  • Paschal,

    Although, I just posted a question on CodeProject, have you tried the same code to handle .gif.ashx? It should "not" work as the gif is binary compared to .css files and the code only handles the string type files.



    Have you tried? Did it work?

Comments have been disabled for this content.