WebResource image not displayed on first page load

Last post 06-28-2009 7:26 AM by ihsany. 1 replies.

Sort Posts:

  • WebResource image not displayed on first page load

    06-26-2009, 9:25 AM
    • Member
      79 point Member
    • benjib98
    • Member since 08-23-2007, 10:26 AM
    • Posts 125

    Hi,

    I have created a custom web control which uses embedded images via an embedded style sheet, so both images and the stylesheet are part of the web control dll. The image is applied in the style sheet as following:

    background-image: url(<%=WebResource('Namesapce.MyControl.Images.ImageName.gif')%>);

    and the images and StyleSheet is added as the WebResource attributes in the AssemblyInfo, the StyleSheet flagged as PerformSubstitution = true

    There is a funny thing going on, when the page is first loaded: the actual image is not "loaded" only until I hover the mouse over the actual image placeholder, in my case a div tag. The image is used as a header background colour and if i have many instances of a div having this image, it is enough to hover the mouse over one of the div instances and then suddenly the image is appears in all placeholders. Is this just the way WebResource works or I am doing something wrong?

  • Re: WebResource image not displayed on first page load

    06-28-2009, 7:26 AM
    Answer
    • Member
      689 point Member
    • ihsany
    • Member since 05-17-2008, 3:05 AM
    • Turkey
    • Posts 156

    try this;

    right click embed image and  click properties;

    set build action to Embedded Resource

    set copy to output to Copy id newer

    i hope this help you..

    ihsany
    ######
    Make It Easy
    --------------dont forget to click <Mark As Answer>------------------
Page 1 of 1 (2 items)