Hi All,

Can somebody tell me what I am doing wrong.

I have a Base Abstract Class

Public MustInherit Class BaseRequestHandler : Inherits System.Web.UI.Page

Protected Overridable Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) 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 BaseRequestHandler

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..

Re: Inheritance Problem when trying to implement Page Controller by John

John
Thu Aug 28 16:46:22 CDT 2003

Binod, I answered this over on the .aspnet newsgroup.
--
John Saunders
Internet Engineer
john.saunders@surfcontrol.com



Re: Inheritance Problem when trying to implement Page Controller by Michael

Michael
Thu Aug 28 16:56:40 CDT 2003

"Binod Nair" <nairbinod@hotmail.com> wrote in
news:#sdpMsabDHA.3896@TK2MSFTNGP11.phx.gbl:

> Public MustInherit Class BaseRequestHandler : Inherits
> System.Web.UI.Page
> Protected Overridable Sub Page_Load(ByVal sender As System.Object,
> ByVal e As System.EventArgs) 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 BaseRequestHandler
> 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().
>

It should be complaining that you have 2 methods of the same method
signature in the abstract class... both called "SomeMethod()". If it is
not complaining with the exact code you've shown, then it should be. It
may think you are overriding the SomeMethod() that is not marked as
"MustOverride"

If these are not the actual method signatures in each class, then show us
the real ones.

--
Michael Lang, MCSD
See my .NET open source projects
http://sourceforge.net/projects/dbobjecter (code generator)
http://sourceforge.net/projects/genadonet ("generic" ADO.NET)


Re: Inheritance Problem when trying to implement Page Controller by John

John
Thu Aug 28 18:17:17 CDT 2003

"Michael Lang" <ml@nospam.com> wrote in message
news:Xns93E5AC6F6463Blang1474icqmailcom@207.46.248.16...
> "Binod Nair" <nairbinod@hotmail.com> wrote in
> news:#sdpMsabDHA.3896@TK2MSFTNGP11.phx.gbl:
>
> > Public MustInherit Class BaseRequestHandler : Inherits
> > System.Web.UI.Page
> > Protected Overridable Sub Page_Load(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) 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 BaseRequestHandler
> > 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().
> >
>
> It should be complaining that you have 2 methods of the same method
> signature in the abstract class... both called "SomeMethod()". If it is
> not complaining with the exact code you've shown, then it should be. It
> may think you are overriding the SomeMethod() that is not marked as
> "MustOverride"

Michael, I don't see two different "SomeMethod" methods. Could you point
them out, please?
--
John Saunders
Internet Engineer
john.saunders@surfcontrol.com



Re: Inheritance Problem when trying to implement Page Controller by Jon

Jon
Fri Aug 29 12:29:39 CDT 2003

Michael Lang <ml@nospam.com> wrote:
> The following was in the original posted code...
> ====================================
> SomeMethod()
>
> End Sub
>
> Public MustOverride Sub SomeMethod()
>
> End Class
> ====================================

Yes, but that first SomeMethod() is a call to the second one, isn't it?
It's within the Page_Load method.

I don't really know VB.NET, but it certainly looks to me like there's
only one declaration of SomeMethod() there...

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Re: Inheritance Problem when trying to implement Page Controller by Michael

Michael
Fri Aug 29 12:49:30 CDT 2003

Jon Skeet <skeet@pobox.com> wrote in
news:MPG.19b99ddda941ccd598a42c@news.microsoft.com:

> Yes, but that first SomeMethod() is a call to the second one, isn't it?
> It's within the Page_Load method.
>
> I don't really know VB.NET, but it certainly looks to me like there's
> only one declaration of SomeMethod() there...
>

Oops. Since it wasn't indented I read it wrong. Also, I'm used to looking
at C# code. I depend on those curly braces and proper indentation to keep
me from getting lost.

--
Michael Lang, MCSD