ASP.NET RESOLVE URL IN CSS EXTERNAL FILE

lois waisbrooker

Total Post:70

Points:494
Posted by  lois waisbrooker
 4515  View(s)
Ratings:
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!
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: ASP.net resolve url in css external file

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!