By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,249 Members | 1,853 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,249 IT Pros & Developers. It's quick & easy.

Partial Classes and Inheritance

P: n/a
In a web application using asp.net 2.0

All my classes are partial classes.

- I noticed that partial class cannot be inherited... is that true?

- I tried to remove the partial keyword , and I receieved this error
Error 1 Missing partial modifier on declaration of type
'NagyResearch.Q_A.Q.QuestionnairePage'; another partial declaration of this
type exists D:\Web Sites\Local
Host\NagyResearch\Q_A\Q\QuestionnairePage.aspx.cs 14 18
http://localhost/NagyResearch/

although I haven't any another partial declaration.
Mar 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Partial classes can't be compiled either. However, the complete classes that
are created either from one part of a partial class which can be used as a
stand-alone class, or from several partial classes combined, can be
compiled, inherited, you name it.

The key here is that a "partial class" is not a class at all. It is a
convenience for the developer, a way of separating the code which
constitutes a class when built can be spread across several source files. In
addition, it provides the ability to recombine these partial class files
into a variety of different versions of a class. I'm not sure how useful
that is, though.

The actual *class* doesn't exist until it is compiled.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Bishoy George" <bi****@bishoy.com> wrote in message
news:ea**************@tk2msftngp13.phx.gbl...
In a web application using asp.net 2.0

All my classes are partial classes.

- I noticed that partial class cannot be inherited... is that true?

- I tried to remove the partial keyword , and I receieved this error
Error 1 Missing partial modifier on declaration of type
'NagyResearch.Q_A.Q.QuestionnairePage'; another partial declaration of
this type exists D:\Web Sites\Local
Host\NagyResearch\Q_A\Q\QuestionnairePage.aspx.cs 14 18
http://localhost/NagyResearch/

although I haven't any another partial declaration.

Mar 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.