473,654 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inheritance problems

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

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
Mar 3 '06 #1
1 1275
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.

"bill" <be****@datamti .com> wrote in message
news:er******** ******@TK2MSFTN GP09.phx.gbl...
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.P age

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

Mar 3 '06 #2

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

Similar topics

11
3232
by: Ricky Romaya | last post by:
Hi, Are there any ways to get multiple inheritace in PHP4? For example, I have 3 parent class, class A, B, and C. I want class X to inherit all those 3 classes. Consider merging those 3 classes is out of the question, as there are class Y which only inherits from class A, etc. TIA
12
5241
by: jinal jhaveri | last post by:
Hi All, I have one question regarding circular inheritance I have 3 files 1) A.py , having module A and some other modules 2) B.py having module B and some other modules 3) C.py having module C and some other modules
7
3280
by: Hung Jung Lu | last post by:
Hi, I think Microsoft did look into Python when they designed C#. (E.g. they got rid of checked exceptions of Java.) However, they followed Java in avoiding multiple inheritance (MI), which is a great leap backward from C++, in my opinion. I understand the why of avoiding virtual data members, since performance is an issue. I understand the problems of MI in C++. But the cure (using interfaces) seems worse than the disease itself. Now...
37
2823
by: Mike Meng | last post by:
hi all, I'm a newbie Python programmer with a C++ brain inside. I have a lightweight framework in which I design a base class and expect user to extend. In other part of the framework, I heavily use the instance of this base class (or its children class). How can I ensure the instance IS-A base class instance, since Python is a fully dynamic typing language? I searched and found several different ways to do this:
14
12900
by: Steve Jorgensen | last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling a particular case of implementation inheritance that would be easy and obvious in a fully OOP language, but is not at all obvious in VBA which lacks inheritance. I'm trying the explanation again now. I often find cases where a limited form of inheritance would eliminate duplication my code that seems impossible to eliminate otherwise. I'm getting very...
22
23347
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete examples?
15
7186
by: Sinex | last post by:
Hi, Why does C# disallow multiple inheritance? Whats the reason behind this? Is there any advantage or is it just a method to avoid some problems (if so, what problems?) that come with multiple inheritance? regards, Sinex
6
2091
by: VR | last post by:
Hi, I read about Master Pages in ASP.Net 2.0 and after implementing some WinForms Visual Inheritance I tryed it with WebForms (let's say .aspx pages, my MasterPage does not have a form tag itself so, cannot be called a WebForm itself, the child pages will implement forms). I created a Master.aspx page and removed all HTML from it, added some code to the .aspx.vb file to add controls to my page. Then I created a Child.aspx and changed the...
6
2531
by: Pascal Polleunus | last post by:
Hi, I'm wondering if there could be problems related to inheritance in the following scenario (with PostgreSQL 7.4.1)... 1 A-table, abstract. Max 10 B-tables that inherit from A, with sometimes some more columns than A. These are also abstracts.
60
4903
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the 'target' programming community herein) to get some community input and verify (or not) the following two statements. Few programmers (3 to7%) UNDERSTAND 'Strategic Functional Migration
0
8372
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
8706
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
8591
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
5621
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
4149
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
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
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
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
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.