How do I Implements Parent class interface in child class

O

owais

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
 
M

Maqsood Ahmed

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
 
F

Francois Bonin [C# MVP]

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.
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top