---
title: "ASP.net resolve url in css external file"  
description: "ASP.net resolve url in css external file"  
author: "Anonymous User"  
published: 2013-04-10  
updated: 2013-04-15  
canonical: https://www.mindstick.com/forum/754/asp-dot-net-resolve-url-in-css-external-file  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# ASP.net resolve url in css external file

Hi Everyone!\
I separate the [css](https://www.mindstick.com/forum/514/background-gradient-ie7-css-problem) from the *.[aspx file](https://www.mindstick.com/forum/108/is-it-possible-to-see-the-code-that-asp-dot-net-generates-from-an-aspx-file). When this\
[background](https://www.mindstick.com/articles/65/how-to-change-background-color-of-tab-control-in-c-sharp)-[image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character): [url](https://www.mindstick.com/forum/436/url-redirection)('<%=Page.ResolveUrl("~/[Themes](https://www.mindstick.com/articles/12368/why-are-html-themes-the-first-selection-of-designers)/Red/[Images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support)/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](https://answers.mindstick.com/qa/40482/why-was-1968-a-year-of-tension-and-turmoil-list-10-events-1-being-the-best-and-10-the-worst-thank-you-in-advance)!

## Replies

### Reply by AVADHESH PATEL

Hi Lois!\
he scriptlet and ~ here is specific to aspx [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) 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.


---

Original Source: https://www.mindstick.com/forum/754/asp-dot-net-resolve-url-in-css-external-file

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
