Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have got a master page(Project>>MasterPages>>MainPage.master) and some images in that page with some path like "../../Images/bg_main_menu.png".

I refer this master page in two forms. One of those form is oresent in the path : Project>>Forms>>Form1.aspx and the other one is : Project>>Forms>>NewFolder>>Form2.aspx

Now for Form2.aspx the image is not getting loaded.

I tried the image path with "~Images/bg_main_menu.png". But it is not working.

Can somebody help?

Regards,
Snigdha
Posted

There is something like ResolveUrl. It should help you out.
Read about it here[^].

A good Tip related to it is posted here[^]. You should use it.


sargamlucy wrote:
"~Images/bg_main_menu.png".

You are missing a forward slash after TILDA (~), before Images.
~/Images/....
 
Share this answer
 
v2
There is some info on msdn about the same issue:

http://msdn.microsoft.com/en-us/library/ms178116.aspx[^]


Maybe it's just as simple by adding the extra /



"~/Images/bg_main_menu.png"

Good luck!
 
Share this answer
 
v2
ResolveUrl dint work properly, but searching for that, i got one more thing called ResolveClientUrl.

The difference between these two is... ResolveUrl can be used for ASP controls and ResolveClientUrl can be used for html controls.


But now I have one more problem. This technique is not working out inside style sheet. If i am mentioning any background image to a style class, then this is not working.

What should I do?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900