473,799 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inheritance Problem

Hi All,

Can somebody tell me what I am doing wrong.

I have a Base Abstract Class

Public MustInherit Class BaseRequestHand ler : Inherits System.Web.UI.P age

Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles MyBase.Load

SomeMethod()

End Sub

Public MustOverride Sub SomeMethod()

End Class

I have a Web Page which Inherits this base class

Public Class ManageCatalog : Inherits BaseRequestHand ler

Public Overrides Sub SomeMethod()

'Code Block

end sub

end class

When I try to run it , I get the error

Compiler Error Message: BC30610: Class 'ManageCatalog_ aspx' must either be
declared 'MustInherit' or override the following inherited 'MustOverride'
member(s): Public Overridable MustOverride Sub SomeMethod().

Plss Help.. I am doing something really stupid..



Nov 17 '05 #1
3 3567
John thanks a lot

The problem was here

I HAD IT AS
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb"
Inherits="TestV BWebApp.BaseReq uestHandler "%>

AND NOT LIKE WHAT John said
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb"
Inherits="TestV BWebApp.WebForm 1"%>

It doesnt make sense to me why it needs to be like this ..Shouldnt it be
like the way i had declared..

John can u share ur thoughts about this.Also can u give an example when the
inherits value in "<%@ Page Language.." is going to be different.

--binod

"Binod Nair" <na*******@hotm ail.com> wrote in message
news:eJ******** ******@TK2MSFTN GP09.phx.gbl...
Hi All,

Can somebody tell me what I am doing wrong.

I have a Base Abstract Class

Public MustInherit Class BaseRequestHand ler : Inherits System.Web.UI.P age

Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles MyBase.Load

SomeMethod()

End Sub

Public MustOverride Sub SomeMethod()

End Class

I have a Web Page which Inherits this base class

Public Class ManageCatalog : Inherits BaseRequestHand ler

Public Overrides Sub SomeMethod()

'Code Block

end sub

end class

When I try to run it , I get the error

Compiler Error Message: BC30610: Class 'ManageCatalog_ aspx' must either be
declared 'MustInherit' or override the following inherited 'MustOverride'
member(s): Public Overridable MustOverride Sub SomeMethod().

Plss Help.. I am doing something really stupid..



Nov 17 '05 #2
"Binod Nair" <na*******@hotm ail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
John thanks a lot

The problem was here

I HAD IT AS
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb" Inherits="TestV BWebApp.BaseReq uestHandler "%>

AND NOT LIKE WHAT John said
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb" Inherits="TestV BWebApp.WebForm 1"%>

It doesnt make sense to me why it needs to be like this ..Shouldnt it be
like the way i had declared..

John can u share ur thoughts about this.Also can u give an example when the inherits value in "<%@ Page Language.." is going to be different.


Here's the way it "normally" works when a CodeBehind page is used. You've
got page WebForm1.aspx. This is parsed and compiled into a class with a
generated name, like, ASPX_WebForm1. This class inherits from the class
mentioned in the Inherits attribute in the Page directive.

WebForm1.aspx.v b contains your codebehind class. It would declare a class
called WebForm1 in the TestVBWebApp namespace. The WebForm1 class inherits
from System.Web.UI.P age. So you have the following:

ASPX_WebForm1 ==> TestVBWebApp.We bForm1 ==> System.Web.UI.P age

An example of when this would be different is in the case where codebehind
is not used. In that case, the Inherits attribute says
Inherits="Syste m.Web.UI.Page". That is:

ASPX_WebForm1 ==> System.Web.UI.P age

As an example of when the Inherits in the codebehind would be different is a
situation like yours:

ASPX_WebForm1 ==> TestVBWebApp.We bForm1 ==> TestVBWebApp.Ba seRequestHandle r
==> System.Web.UI.P age

Note that in this case, you still need the Inherits="TestV BWebApp.WebForm 1",
since that's the class which ASPX_WebForm1 inherits directly from.
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com
Nov 17 '05 #3
John..

Thanks a lot.I guess I need to keep reading rather than doing coding.

"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:e4******** ******@TK2MSFTN GP12.phx.gbl...
"Binod Nair" <na*******@hotm ail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
John thanks a lot

The problem was here

I HAD IT AS
<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Web Form1.aspx.vb"
Inherits="TestV BWebApp.BaseReq uestHandler "%>

AND NOT LIKE WHAT John said
<%@ Page Language="vb" AutoEventWireup ="false"

Codebehind="Web Form1.aspx.vb"
Inherits="TestV BWebApp.WebForm 1"%>

It doesnt make sense to me why it needs to be like this ..Shouldnt it be
like the way i had declared..

John can u share ur thoughts about this.Also can u give an example when

the
inherits value in "<%@ Page Language.." is going to be different.


Here's the way it "normally" works when a CodeBehind page is used. You've
got page WebForm1.aspx. This is parsed and compiled into a class with a
generated name, like, ASPX_WebForm1. This class inherits from the class
mentioned in the Inherits attribute in the Page directive.

WebForm1.aspx.v b contains your codebehind class. It would declare a class
called WebForm1 in the TestVBWebApp namespace. The WebForm1 class inherits
from System.Web.UI.P age. So you have the following:

ASPX_WebForm1 ==> TestVBWebApp.We bForm1 ==> System.Web.UI.P age

An example of when this would be different is in the case where codebehind
is not used. In that case, the Inherits attribute says
Inherits="Syste m.Web.UI.Page". That is:

ASPX_WebForm1 ==> System.Web.UI.P age

As an example of when the Inherits in the codebehind would be different is

a situation like yours:

ASPX_WebForm1 ==> TestVBWebApp.We bForm1 ==> TestVBWebApp.Ba seRequestHandle r ==> System.Web.UI.P age

Note that in this case, you still need the Inherits="TestV BWebApp.WebForm 1", since that's the class which ASPX_WebForm1 inherits directly from.
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

Nov 17 '05 #4

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

Similar topics

3
1953
by: Mark A. Gibbs | last post by:
Good day, i'm having a bit of trouble with a base class i'm working on. this is what it boils down to: template <typename T> class foo { protected: foo() { T* p = static_cast<T*>(this); }
9
1371
by: vidalsasoon | last post by:
Ok, this is the structure of my classes. " class Global " | " ------------------------------------------- " | | "class SomeForm1 class SomeForm2
1
1515
by: Michael | last post by:
Hello, I'm trying to implement sample I found on page templates, so I do not have to maintain "<html><head>..." on all my documents. But don't let that confuse you, this is an inheritance problem. Basically, I'm using VS.NET IDE for development, If I use the src="..." tag in the @Page directive it works, but if I use codebehind="...", I get a runtime error that it cannot find my first class I'm inheriting. It's almost like the...
0
986
by: Mariano | last post by:
Hi, I have posted a bug of the forms designer that overwrites always the Icon, thus preventing Icon inheritance when you derive from a form. I am trying to overcome this by adding an ImageList in the base class. However, this doesn't solve my problem about Icon inheritance. The idea is to put Icon showing code inside the base form class. I add this code to the new() sub: 'Show the inherited icon Me.Icon = Icon.FromHandle((New...
9
3300
by: surendran.d | last post by:
hi, can diamond inhertance problem be solved using virtual functions,, or can only be done with scope resolution operators.. is there any other way to solve this problem... Thanks, suri
2
929
by: goldie11 | last post by:
Hi, I have two classes - A,B that inherit from an abstract class C. The problem is that I need a global field which has always the same value for the two classes. If I put the field in class C - As I understand inheritance - both classes will recognize the field but will have their own values. Please help. Thanks.
4
2029
by: amidzic.branko | last post by:
I'm trying to solve a problem using inheritance and polymorphism in python 2.4.2 I think it's easier to explain the problem using simple example: class shortList:
8
1720
by: Hans-Dieter Dreier | last post by:
Hi NG, I have an inheritance like this: class a_interface { virtual bool x() = 0; }; class a_version_1 : public a_interface
3
2904
by: Leo Seccia | last post by:
Hello everyone, I have a c# project with a sql server database. I have a number of lookup tables in my database which I successfully managed to import into my LINQ dataclasses. eg. Table: tlkpColor (PK) tlkpColorID
1
1267
by: thedoxp | last post by:
I'm new at c# and I have little problem when use List and Inheritance I have Inheritance& Like this public abstract class Light {} public class OpenLight:Light {}
0
9687
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
9541
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
10251
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...
0
10027
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
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.