Home > DeveloperSection > Forums > ASP.net resolve url in css external file
lois waisbrooker
lois waisbrooker

Total Post:70

Points:494
Posted on    April-10-2013 1:59 AM

 CSS-CSS3 CSS-CSS3 
Ratings:


 1 Reply(s)
 3489  View(s)
Rate this:
Hi Everyone!

I separate the css from the *.aspx file. When this

background-image: url('<%=Page.ResolveUrl("~/Themes/Red/Images/Contestant/1.jpg)%>';)
was in the aspx file it worked, and now it's not working.

do you know any other way ?

Thank you in advance!


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    April-15-2013 7:49 AM

Hi Lois!

he scriptlet and ~ here is specific to aspx file and could not be used in css.

Change

background-image: url('<%=Page.ResolveUrl("~/Themes/Red/Images/Contestant/1.jpg)%>';)
To

background-image: url('/Themes/Red/Images/Contestant/1.jpg')
Assuming the Themes folder is at root your your site.

Don't want to miss updates? Please click the below button!

Follow MindStick