Prevent tag properties automaticaly generated by ASP.NET

Discussion in 'ASP .Net Building Controls' started by Henri, May 20, 2004.

  1. Henri

    Henri Guest

    When I use System.Web.UI.WebControls.Image, ASP.NET automaticaly outputs :
    <img border="0" />
    Is there a way to prevent this border="0" to be added, without creating a
    custom Control?
    Henri, May 20, 2004
    #1
    1. Advertising

  2. Henri

    Teemu Keiski Guest

    Hi,

    Image control works such that if the BorderWidth property is considered to
    be empty, it outputs the '0', And this logic happens in rendering phase of
    the Image control, so it can be changed, unless you write a custom control
    or use <img runat="server">, that is a HTML server control. They are
    rendered exactly as you want them to be.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist
    http://blogs.aspadvice.com/joteke


    "Henri" <> wrote in message
    news:O3t%...
    > When I use System.Web.UI.WebControls.Image, ASP.NET automaticaly outputs :
    > <img border="0" />
    > Is there a way to prevent this border="0" to be added, without creating a
    > custom Control?
    >
    >
    >
    Teemu Keiski, May 20, 2004
    #2
    1. Advertising

  3. Henri

    Henri Guest

    Thanks a lot for your help Teemu!
    I use HtmlControls.HtmlImage instead of WebControls.Image and everything's
    OK now!

    "Teemu Keiski" <> a écrit dans le message de
    news:...
    > Hi,
    >
    > Image control works such that if the BorderWidth property is considered to
    > be empty, it outputs the '0', And this logic happens in rendering phase

    of
    > the Image control, so it can be changed, unless you write a custom control
    > or use <img runat="server">, that is a HTML server control. They are
    > rendered exactly as you want them to be.
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    > http://blogs.aspadvice.com/joteke
    >
    >
    > "Henri" <> wrote in message
    > news:O3t%...
    > > When I use System.Web.UI.WebControls.Image, ASP.NET automaticaly outputs

    :
    > > <img border="0" />
    > > Is there a way to prevent this border="0" to be added, without creating

    a
    > > custom Control?
    > >
    > >
    > >

    >
    >
    >
    Henri, May 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thierry
    Replies:
    1
    Views:
    321
    Wim Hollebrandse
    Oct 21, 2003
  2. NWx
    Replies:
    3
    Views:
    445
  3. Henri
    Replies:
    0
    Views:
    312
    Henri
    May 20, 2004
  4. shruds
    Replies:
    1
    Views:
    709
    John C. Bollinger
    Jan 27, 2006
  5. PHP2
    Replies:
    8
    Views:
    436
    Howard
    Jul 28, 2004
Loading...

Share This Page