473,606 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Class Declaration Problem with Inherits and Implements

Hi,

I have the following class declaration and the ide is giving the following
errors.

Interface 'System.Web.UI. IPostBackDataHa ndler' is already implemented by
base class 'System.Web.UI. HtmlControls.Ht mlInputRadioBut ton'.

'System.Web.UI. IPostBackDataHa ndler.LoadPostD ata' is already implemented by
base class 'System.Web.UI. HtmlControls.Ht mlInputRadioBut ton' and cannot be
implemented again.

Public Class ParticipantRadi oButton
Inherits System.Web.UI.H tmlControls.Htm lInputRadioButt on
Implements IPostBackDataHa ndler
Private Function LoadPostData(By Val postDataKey As String, _
ByVal postCollection As NameValueCollec tion) As Boolean
Implements IPostBackDataHa ndler.LoadPostD ata

End Function

Nov 21 '05 #1
7 5365
I can't believe nobody knows how to do this. Anyhelp is appreciated.
Nov 21 '05 #2
It's telling you that the base class already implements the interface.
There is no need for you to do it again.

Nov 21 '05 #3
Why does C# allow you Implement an Interface that the Inherited class is
already implementing and VB.Net does not?

This pisses me of there has to be another way to do this by using a generic
control or something .
Nov 21 '05 #4
Chris,
VB.NET 2002 & 2003 (.NET 1.0 & 1.1) does not allow a derived class to
implement the same interface as a base class (although corresponding
versions of C# does, remember VB.NET is not C#, nor is C# VB.NET)...

I'm not certain as to the reason for the restriction...

My understanding is that VB 2005 (.NET 2.0) will allow a derived class to
implement the same interface as a base class. Unfortunately I don't have a
reference handy, nor my VPC handy to verify...

Hope this helps
Jay

"Chris Lane" <Ch*******@disc ussions.microso ft.com> wrote in message
news:BE******** *************** ***********@mic rosoft.com...
| Hi,
|
| I have the following class declaration and the ide is giving the following
| errors.
|
| Interface 'System.Web.UI. IPostBackDataHa ndler' is already implemented by
| base class 'System.Web.UI. HtmlControls.Ht mlInputRadioBut ton'.
|
| 'System.Web.UI. IPostBackDataHa ndler.LoadPostD ata' is already implemented
by
| base class 'System.Web.UI. HtmlControls.Ht mlInputRadioBut ton' and cannot be
| implemented again.
|
| Public Class ParticipantRadi oButton
| Inherits System.Web.UI.H tmlControls.Htm lInputRadioButt on
| Implements IPostBackDataHa ndler
|
|
| Private Function LoadPostData(By Val postDataKey As String, _
| ByVal postCollection As NameValueCollec tion) As Boolean
| Implements IPostBackDataHa ndler.LoadPostD ata
|
| End Function
|
|
|
Nov 21 '05 #5
I know that but C# lets you do it so you can implement your own version of
the interfaces method.

HtmlInputRadioB utton.IPostBack DataHandler.Loa dPostData MethodSee Also
HtmlInputRadioB utton Class | HtmlInputRadioB utton Members |
System.Web.UI.H tmlControls Namespace | Managed Extensions for C++ Programming
Language
C#

C++

JScript

Visual Basic

Show All
This member supports the .NET Framework infrastructure and is not intended
to be used directly from your code.

[Visual Basic]
Private Function LoadPostData( _
ByVal postDataKey As String, _
ByVal postCollection As NameValueCollec tion _
) As Boolean Implements IPostBackDataHa ndler.LoadPostD ata

[C#]
bool IPostBackDataHa ndler.LoadPostD ata(
string postDataKey,
NameValueCollec tion postCollection
);

It's private for
"Chris Dunaway" wrote:
It's telling you that the base class already implements the interface.
There is no need for you to do it again.

Nov 21 '05 #6
Jay,

"Jay B. Harlow [MVP - Outlook]" <Ja************ @tsbradley.net> schrieb:
My understanding is that VB 2005 (.NET 2.0) will allow a derived class to
implement the same interface as a base class. Unfortunately I don't have a
reference handy, nor my VPC handy to verify...


Yes, VB 2005 (August CTP) allows interface re-implementation.

\\\
Public Interface IGoo
Sub Bla()
End Interface

Public Class Bar
Implements IGoo

Public Sub Bla() Implements IGoo.Bla
'
End Sub
End Class

Public Class FooBar
Inherits Bar
Implements IGoo

Public Overloads Sub Bla() Implements IGoo.Bla
'
End Sub
End Class
///

There will be a warning given on 'Implements IGoo.Bar' of class 'FooBar'
("Warning: 'IGoo.Bla' is already implemented by the base class 'Bar'.
Re-implementation of sub assumed").

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7
Thanks, Jay and Herfried. I guess I am SOL unless I use C# to do this for now.

Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2131
by: Chris Lane | last post by:
public class ParticipantRadioButton : System.Web.UI.HtmlControls.HtmlInputRadioButton, IPostBackDataHandler { bool IPostBackDataHandler.LoadPostData( string postDataKey, NameValueCollection postCollection ) { bool result = false; string postedValue = postCollection; if (postedValue != null && postedValue == this.Value) { if ( this.Checked) { return result;
13
1850
by: Duron | last post by:
I created a new folder using VS.NET 2003. Then I created a new web form under that folder, say, \Member\Default.aspx. However, even if I didn't do anything to that page, a run-time error appears when I try to run it -- Can not load class MySite._Default. I am using VB to write codes. Does anyone have any idea why this problem happens? Thanks!
4
2842
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. '**************************************************************************** ' Issues '****************************************************************************
7
1500
by: Ornez | last post by:
Hi, My customer has an abstract class with some interface A . he wants me to Inherit his Class and implement the intrface with some functionality in a new class B. I need to know how he would access my implementation without a Reference . Can a base class generates his derived classes ? Like when i will use some method it will be happen in others derived classes ?
3
1932
by: Trammel | last post by:
Hi, I recently upgraded to VB.net from VB6.. and woah... I feel lost :¬O One of my reasons for upgrading is I was told that VB.net can do class inheritance and subclassing easier. Would someone be so kind as to provide a small demo about classes for some
5
1940
by: RSH | last post by:
I havent been able to set a property from another class with out getting some sort of error. Can someone please tell me what I'm doing wrong here? Public Class Form1
9
5495
by: silversurfer2025 | last post by:
Hello everyone, I am currently having problems with a C++ abstract class. I have a class FrameWork.h which defines some methods (of which some are abstract, i.e. virtual void method() = 0). In FrameWork.cpp I define some of the methods while I naturally leave the abstract methods undefined. Now I wrote a class FrameWork_GUI.h which inherits from the abstract FrameWork class and implements the missing (so far abstract) methods....
0
953
by: nestor082 | last post by:
Problem: The event handler for an instance of a derived class does not seem to be reached. In the following code I declare an interface "IA", a virtual (mustinherit) class "A", implementing "IA" and an implementation of "A" called "B" Since IA contains a declaration of an event called "Exception", A must declare an implementation of Exception that CANNOT be then triggered from B (since .NET does not allow to trigger events from base...
1
2488
by: Mitch | last post by:
I have several classes that inherit other classes. I need to be able to sort the Mesh class based on its inherited list of Poly.ZMax,. How do I use IComparer or IComparable to achieve this? Mitch. Public Class Poly : Inherits List(Of Vector) Private mZMax As Double
0
8024
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7959
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8105
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8310
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5466
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3987
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.