Problem Overriding Enabled Property in Composite Control

Discussion in 'ASP .Net Web Controls' started by Jimmy Seow, Apr 11, 2004.

  1. Jimmy Seow

    Jimmy Seow Guest

    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.
     
    Jimmy Seow, Apr 11, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    629
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. sleigh
    Replies:
    1
    Views:
    2,694
    sleigh
    Feb 12, 2004
  3. Chad
    Replies:
    0
    Views:
    227
  4. Andrew Backer

    Composite & issues with Viewstate/Enabled property

    Andrew Backer, Jul 18, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    165
    Andrew Backer
    Jul 19, 2005
  5. Bob Jones

    Composite control - sub control as a property not rendering

    Bob Jones, Apr 6, 2007, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    248
    Bob Jones
    Apr 9, 2007
Loading...

Share This Page