How to create friendly url in asp.net 2
3 answers
You need to make sure you use the "~ /" path notation in your images, and make sure they are all server controls with runat = "server". Otherwise, image URLs will not be rewritten.
For example, if you have a page that is being rewritten with:
/Item/Bicycle.aspx
to
/Item.aspx?id=1234
Then what happens is that the link to the image looks like this:
<img src='images/something.gif' />
will break. So you should instead do something like this:
<asp:image imageurl='~/images/something.gif' runat='server' id='img1'/>
Alternatively, you can use absolute paths for your images. Or you can embed as much as possible in your .css files.
+1
source to share