Last post Mar 19, 2008 05:24 AM by Nai-Dong Jin - MSFT
Mar 17, 2008 07:11 AM|benjib98|LINK
I have created a grid webcontrol, simple and general using embedded images from code behind ( ClientScriptManager ) and also from CSS as background-image property. Now while the images referenced from code behind are fine, for some reason the images for
the CSS background-image property are not rendered or find. The images are flagged as embedded, the WebResource path is ok in the AssemblyInfo, the CSS is also flagged as embedded resource and the CSS property is like below:
I suspect that this is due the embedded webresource issue, but how could I pass the embedded image's url in the CSS file, like in the code behind:
I thought that the normal way of url path is enough in the webcontrol, when using the background-image property. Can someone answer this question?
Mar 17, 2008 09:18 AM|benjib98|LINK
I have partially sorted out the issue as I found some blogs on this matter and the solution was to pass an attribute to the CSS webresource in the AssemblyInfo file:
[assembly: WebResource("WebControls.Grid.CSS.Grid.css", "text/css", PerformSubstitution = true)]
as the embedded CSS accessing an embedded image file, so need to use the PerformSubstitution attribute.
Mar 17, 2008 09:20 AM|benjib98|LINK
This works only in FF, but for some reason in IE7 if I do an AJAX postback the webresource is present for the image , but it is rendered as no background image.
Mar 19, 2008 05:24 AM|Nai-Dong Jin - MSFT|LINK
This side effect might be related to WebResource caching - when your website is in debug mode (<compilation debug="true" /> in web.config) files streamed by WebResource.axd
are not cached by the browser.
For more information, see: