ali raza

C#, .Net ,Asp.net and my thoughts

How to get relative path for images in asp.net

One common problem developers face  while using master page that images did not get proper path, there are many ways to do this. But best way to use  ResolveClientUrl . For example :

<img src=”<%= ResolveClientUrl(”images/disco_night.png”)%>” alt=”Disco night” />

after rendering  it converted it as

<img src=”../images/disco_night.png” mce_src=”../images/disco_night.png” alt=”Disco night” />

2 responses to “How to get relative path for images in asp.net

  1. Ash April 20, 2008 at 7:48 am

    Thank you so much 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: