html - image URL concern for CSS changer inside MVC controller -


i have style controller calls styleresolver action , lets me switch between css theme used.

if (contractstate == "fl" || contractstate == "tx") {     response.contenttype = "text/css";     return razor.parse(system.io.file.readalltext(server.mappath("~/content/genesis-theme-flat/jquery-ui-1.10.4.custom.css"))); } else if (contractstate == "az" || contractstate == "ca" ||     contractstate == "ga" || contractstate == "mo" ||     contractstate == "nm" || contractstate == "sc" ||     contractstate == "ut") {     response.contenttype = "text/css";     return razor.parse(system.io.file.readalltext(server.mappath("~/content/nowcom-theme-flat/jquery-ui-1.10.2.custom.css"))); } 

problem image related css inside files two, results in file path problem

.ui-widget-content {     border: 1px solid #ececec;     background: #ffffff url("images/ui-bg_flat_0_ffffff_40x100.png") 50% 50% repeat-x;     color: #333; } .ui-widget-header {     border: 1px solid #ececec;     background: #ececec url("images/ui-bg_highlight-soft_0_ececec_1x100.png") 50% 50% repeat-x;     color: #960000;     font-weight: bold; }      

these images inside these folder.

enter image description here

resulting path:

http://localhost:50402/style/images/ui-bg_flat_0_ffffff_40x100.png 404 (not found) http://localhost:50402/style/images/ui-bg_highlight-soft_0_ececec_1x100.png 404 (not found) 

it seems after calling razor.parse, url not pointed "content/name-of-theme/images" folder, instead includes calling style controller. can fix path displayed resolve 404 issue images?

fixed forcing url path way.

url(/content/genesis-theme-flat/images/ui-bg_glass_0_960000_1x400.png)


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -