HighTechTalks DotNet Forums  

Limit what controls are allowed within another control?

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Limit what controls are allowed within another control? in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Dave
 
Posts: n/a

Default Limit what controls are allowed within another control? - 09-07-2006 , 10:20 PM






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.



Reply With Quote
  #2  
Old   
Brennan Stehling
 
Posts: n/a

Default Re: Limit what controls are allowed within another control? - 09-10-2006 , 08:39 PM






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.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.