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

F

Fao, Sean

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,
 
B

Bruce Barker

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top