Why is MyControl.ToolTip In a <span> Tag?

Discussion in 'ASP .Net' started by Fao, Sean, Jan 26, 2006.

  1. Fao, Sean

    Fao, Sean Guest

    I'm trying to set the title attribute on a CheckBox and I'm having some
    issues in ASP.NET 1.1.

    The title attribute in the following example is valid in HTML 4.01
    Transitional:

    <input id="MyCheckBox" type="checkbox" title="ToolTip">

    However, ASP.NET doesn't like it. No matter what I do, ASP.NET places
    my control inside of a span tag with the title attribute set in the
    span, instead:

    <span title="ToolTip"><input id="MyCheckBox" type="checkbox"></span>

    I've tried Setting the title in HTML, setting the ToolTip property of
    the CheckBox, as well as attempting to use the
    MyCheckBox.Attributes.Add("title", "ToolTip") method.

    All of them have resulted in the same HTML output.

    What's going on?

    Thank you in advance,

    --
    Sean
    Fao, Sean, Jan 26, 2006
    #1
    1. Advertising

  2. Fao, Sean

    Bruce Barker Guest

    the checkbox is an abstracted control. like most of the asp.net control, it
    generates a span to contain any of the internal rendered html. if you add
    attributes, they are applied to the span. type the html control version if
    you need this level of control. in version 2.0, tooltip support has benn
    added.

    -- bruce (sqlwork.com)






    "Fao, Sean" <-WANT-NO-SPAM> wrote in message
    news:%234L%23%...
    > I'm trying to set the title attribute on a CheckBox and I'm having some
    > issues in ASP.NET 1.1.
    >
    > The title attribute in the following example is valid in HTML 4.01
    > Transitional:
    >
    > <input id="MyCheckBox" type="checkbox" title="ToolTip">
    >
    > However, ASP.NET doesn't like it. No matter what I do, ASP.NET places my
    > control inside of a span tag with the title attribute set in the span,
    > instead:
    >
    > <span title="ToolTip"><input id="MyCheckBox" type="checkbox"></span>
    >
    > I've tried Setting the title in HTML, setting the ToolTip property of the
    > CheckBox, as well as attempting to use the
    > MyCheckBox.Attributes.Add("title", "ToolTip") method.
    >
    > All of them have resulted in the same HTML output.
    >
    > What's going on?
    >
    > Thank you in advance,
    >
    > --
    > Sean
    Bruce Barker, Jan 26, 2006
    #2
    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. shruds
    Replies:
    1
    Views:
    707
    John C. Bollinger
    Jan 27, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,665
    Smokey Grindel
    Dec 2, 2006
  3. Radu
    Replies:
    1
    Views:
    519
    Bruce Barker
    Jan 8, 2007
  4. JX
    Replies:
    1
    Views:
    327
    Coskun SUNALI [MVP]
    Feb 3, 2008
  5. JX
    Replies:
    0
    Views:
    400
Loading...

Share This Page