Unexpected behavior with an ImageButton / Image control missing it's ImageUrl value

Last post 02-16-2009 7:06 PM by scottgal. 0 replies.

Sort Posts:

  • Unexpected behavior with an ImageButton / Image control missing it's ImageUrl value

    02-16-2009, 7:06 PM
    Locked
    • Member
      108 point Member
    • scottgal
    • Member since 02-26-2008, 1:56 AM
    • Seattle, WA
    • Posts 24
    • AspNetTeam

    We have had a report of an issue when using an ASP.NET Image / ImageButton control where the developer does not specify an ImageUrl.
    This is the case by default when dragging an ImageButton / Image control from the toolbox into your page. e.g.,
     

     <input type="image" name="ImageButton1" id="ImageButton1" src="" mce_src="" style="border-width:0px;" /> 
     Will cause the following HTML to be rendered when the source for the generated page is viewed in your browser.
     
    <input type="image" name="ImageButton1" id="ImageButton1" src="" mce_src="" style="border-width:0px;" />
     Notice that the 'src' for this element is defined as "", this wil actually cause a GET request back to the server, which the server will respond to by returning the default document for this particular site.

    We will be making ImageUrl a required element for these controls in future releases however, in current versions you should ensure that you always set the ImageUrl property of these controls to avoid an additional call being made for your default document.
Page 1 of 1 (1 items)