Problem Overriding Enabled Property in Composite Control

J

Jimmy Seow

Dear All,
I have a situation where I created a ASP.NET Composite Control using a textbox and a button.
If I set the control to "disabled", the textbox and button gets greyed out but are actually not disabled because I can still type in something into the textbox and click on the button.
So, I created an Enabled property and overridden the base Enabled property and that works just fine.

<Category("Appearance"), Description("blah blah.")> _
Public Overrides Property Enabled() As Boolean
Get
EnsureChildControls()
Return MyBase.Enabled
End Get

Set(ByVal Value As Boolean)
EnsureChildControls()
_txtText.Enabled = Value
_cmdPick.Enabled = Value
MyBase.Enabled = Value
End Set
End Property

The problem is that when I try to set the Enabled property on the Webform itself that it gives me an error message - "Ambiguous Match Found" in the code below.

<pop:popuppicker enabled="False" id="PopupPicker1" runat="server" ></pop:popuppicker>

Any idea why? It doesn't just occur with the Enabled property, it also occurs for other overridden properties like Visible.

Thanks for any help.
 

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,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top