Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I Implements Parent class interface in child class

Reply
Thread Tools

How do I Implements Parent class interface in child class

 
 
owais
Guest
Posts: n/a
 
      05-19-2005
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.RaisePostDataCh angedEvent

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/
 
Reply With Quote
 
 
 
 
Maqsood Ahmed
Guest
Posts: n/a
 
      05-19-2005
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 ***
 
Reply With Quote
 
 
 
 
owais
Guest
Posts: n/a
 
      05-20-2005
Thanks for the reply, yes i know it is
but i don't understand in C# it work

Owais

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
 
Reply With Quote
 
Francois Bonin [C# MVP]
Guest
Posts: n/a
 
      06-23-2005
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" <sohail29@-NOSPAM-hotmail.com> 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/



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
Using abstract class that implements interface Zuisman Moshe Java 24 04-21-2009 06:23 PM
child jitter vs parent shaping vs child class-default on 871 and 1841 Robertas Cisco 0 02-23-2007 01:28 PM
Cant a class extends a abstract class and implements a interface at once?? moxosyuri@gmail.com Java 8 09-27-2006 12:47 AM
Pass from parent to child, then update parent with child value... Noel Dolan Javascript 0 07-18-2004 05:52 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57