how can make all anchor tag (<a>) and image (<img>) fully qualified url in ASP.NET?
how开发者_JAVA百科 can make all anchor tag and image tag in master and detail pages (asp.net) fully qualified url?
for example: http://example.com/path/file.aspxIm using url rewriting and want all my path be fully qualified.
plz write your code.use like below
<a href="./test.aspx">sample</a>
The only way I'm aware of to catch both server control output and standard HTML output is to rewrite the handler output on the fly. I wrote an HttpModule a long time ago that rewrites handler output to fully qualified URLs (<a href="../foo.gif"> to <a href="http://yoursite/images/foo.gif">) for use with FeedBurner. You may be able to take that code and adapt it for your needs.
Note that there may be a performance impact if you take this approach and you will want to ensure that's acceptable.
精彩评论