background image of a css loaded as an embedded resource

╄→尐↘猪︶ㄣ 提交于 2020-01-06 15:18:07

问题


I have a control created in a Class Library and it should be styled by default with some CSS. I've created a CSS file, added it to the library and I am embedding it as a resource, so that it can be used for the default styling.

The CSS file contains some classes that set the background-image property. The images used for this are added as embedded resources in my library as well. As expected, the CSS will run correctly, but it will not display the images since they are added relative to the css file, so a request for ../images/my_image.png will result in a 404 since it actually does not exist as my_image.png, but downloaded as a .axd resource.

Any ideas on how to overcome this?

Any and all help is greatly appreciated.

Kali.


回答1:


Why not having done this myself I remember reading an article for getting the javascript in an embedded resource.

Accessing Embedded Resources through a URL using WebResource.axd http://www.4guysfromrolla.com/articles/080906-1.aspx



来源:https://stackoverflow.com/questions/5965378/background-image-of-a-css-loaded-as-an-embedded-resource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!