By default a new custom control will use the span tag. But you can
change that by overriding the TagKey property. It returns a
HtmlTextWriterTag. In the case of a list control, it returns
HtmlTextWriterTag.Select. Below is the C# code to do that.
protected override HtmlTextWriterTag TagKey
{
get
{
return HtmlTextWriterTag.Select;
}
}
You can find more here...
http://msdn2.microsoft.com/en-us/library/f820d25y.aspx
Brennan Stehling
http://brennan.offwhite.net/blog/
Dave wrote:
Quote:
In buidling custom web controls, what do you have to do to restrict what
controls are allowed inside the parent control and so only the allowable
nested ones appear in intellisense (i.e ListBox is the only thing displayed
in a DropDownList control). Anything to illustrate in the right direction to
build controls this way would be helpful. Thanks. |