Controlling web control instances on Web Form

I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class.
0
supered
5/8/2007 3:18:42 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 6 followers.

💬 2 Replies
👁️‍🗨️ 2470 Views



Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object will be created.

My last project - .NET Tip of The Day.org
0
Sirko
5/8/2007 8:53:44 PM

I know what a custom control, server control and user control are, what is a composite control?
The previous poster gave you the only answer I've ever seen so if it works for you please mark that post as the answer.
0
bucketofsquid
5/8/2007 9:16:57 PM
Reply: