How do I Implements Parent class interface in child class

Discussion in 'ASP .Net' started by owais, May 19, 2005.

  1. owais

    owais Guest

    Hi,

    I have a problem, I want to implements Parent class interface methods in child class. for e.g

    -------------- Test1.vb ----------------
    Imports System
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    Imports System.Globalization

    Public Class Test1
    Inherits RadioButton
    Implements IPostBackDataHandler

    Public Function LoadPostData(ByVal postDataKey As String, ByVal postCollection As System.Collections.Specialized.NameValueCollection) As Boolean Implements System.Web.UI.IPostBackDataHandler.LoadPostData

    End Function

    Public Sub RaisePostDataChangedEvent() Implements System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent

    End Sub
    End Class

    -------------------------------------------------

    when i compiling this class it gives me error

    " Interface 'System.Web.UI.IPostBackDataHandler' is already implemented by base class 'System.Web.UI.WebControls.RadioButton'."

    Please help me in this regard

    Thanks
    Owais

    ---
    Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
     
    owais, May 19, 2005
    #1
    1. Advertising

  2. Hello,
    This is because RadioButton inherits from CheckBox which in turn
    implements IPostBackDataHandler interface. It means that your control's
    base class already implements the interface and you can not overwrite
    its implementation.

    Cheers :)
    Maqsood Ahmed [MCP,C#]
    Kolachi Advanced Technologies
    http://www.kolachi.net

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Maqsood Ahmed, May 19, 2005
    #2
    1. Advertising

  3. owais

    owais Guest

    owais, May 20, 2005
    #3
  4. It depends in which way you implement it.
    You can have two implementation of the same interface function if one of
    them is an explicit interface implementation.

    "owais" <> wrote in message
    news:...
    > Thanks for the reply, yes i know it is.
    > but i don't understand in C# it works
    >
    > Owais
    >
    > ---
    > Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
     
    Francois Bonin [C# MVP], Jun 23, 2005
    #4
    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. Replies:
    8
    Views:
    538
  2. Zuisman Moshe
    Replies:
    24
    Views:
    2,984
    Zuisman Moshe
    Apr 21, 2009
  3. Emanuele D'Arrigo

    Does Class implements Interface?

    Emanuele D'Arrigo, Aug 27, 2009, in forum: Python
    Replies:
    7
    Views:
    368
    Zvezdan Petkovic
    Aug 28, 2009
  4. Noel Dolan
    Replies:
    0
    Views:
    238
    Noel Dolan
    Jul 18, 2004
  5. Bitswapper
    Replies:
    5
    Views:
    150
    Prasad, Ramit
    Aug 27, 2013
Loading...

Share This Page