Inheritance problems

B

bill

What's up with inheritance in code behind? Is it reliable, or should I skip
it and forget about using inheritance in web forms until they get it right?

I'm using VB.NET 2005

I have a web form named wfBase.aspx.

In the code behind I have

Partial Public Class wfBase
Inherits System.Web.UI.Page

and I have some public methods and variables.

I have another form named wfForm.aspx. In this code behind I have

Imports wfBase 'is this necessary?
Partial Class wfForm
Inherits wfBase

Everything works great.
Suddenly it stops working, and there are errors that wfBase contains no
public members.
I have to close Visual Studio and open it again, and then it works fine for
awhile, and then it happens again. Sometimes I only have to close the
solution and open it again. This is very aggravating.

Is there something I could be doing wrong?

Thanks
Bill
 
K

Kevin Spencer

Don't inherit the other part of your partial classes. Partial classes are
classes which are defined in multiple source code documents, which are
merged at compile-time. In essence, you're defining your class as inheriting
itself, which is what is causing the problem.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.
 

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,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top