Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Online Members
baskar
More...
Forums
»
.NET
»
ASP.NET
»
what is partial class?
Posted Date:
18 Jan 2008
Posted By::
Ravindra Singh
Member Level:
Gold
Member Rank:
1730
Points
: 2
Responses:
6
hi all,
in every asp.net code behind page a partial class is added.what is partial class means??
thanks
Tweet
Responses
#179840 Author:
Shanmugam
Member Level:
Gold
Member Rank:
0
Date: 18/Jan/2008 Rating:
Points
: 2
It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all parts are combined when the application is compiled.
#179842 Author:
Harsha
Member Level:
Gold
Member Rank:
0
Date: 18/Jan/2008 Rating:
Points
: 2
It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all parts are combined when the application is compiled. There are several situations when splitting a class definition is desirable:
When working on large projects, spreading a class over separate files allows multiple programmers to work on it simultaneously.
public partial class CoOrds
{
private int x;
private int y;
public CoOrds(int x, int y)
{
this.x = x;
this.y = y;
}
}
public partial class CoOrds
{
public void PrintCoOrds()
{
System.Console.WriteLine("CoOrds: {0},{1}", x, y);
}
}
class TestCoOrds
{
static void Main()
{
CoOrds myCoOrds = new CoOrds(10, 15);
myCoOrds.PrintCoOrds();
}
}
#179853 Author:
Pawan Tiwari
Member Level:
Gold
Member Rank:
410
Date: 18/Jan/2008 Rating:
Points
: 2
The purpose of partial classes is to allow a class's definition to span across multiple files
Pawan Tiwari
Senior Software engineer
07814140365
My Blog
#179868 Author:
Dhivya
Member Level:
Gold
Member Rank:
0
Date: 18/Jan/2008 Rating:
Points
: 2
Partial classes can improve code readability and maintainability by providing a powerful way to extend the behavior of a class and attach functionality to it.
#180075 Author:
Shiva SaiRam
Member Level:
Gold
Member Rank:
186
Date: 18/Jan/2008 Rating:
Points
: 2
A Partial class is a class that can be split into two or more classes. This means that a class can be physically separated into other parts of the class within the same namespace. All the parts must use the partial keyword. All the other classes should also have the same access modifier. At the compile time, all the partial classes will be treated as a single class. Let us list some advantages of having partial classes.
• Allows a clean separation of business logic layer and the user interface.
• The UI code can be hidden from the developer.
• Makes the debugging easier.
#281449 Author:
asdf
Member Level:
Silver
Member Rank:
0
Date: 14/Aug/2008 Rating:
Points
: 0
• Partial Class
It’s a keyword where classes, struct and interface can use it for span across multiple files like Generating a part of a class SO THAT multiple files can be beneficial.
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
very urgent
Previous :
Threads in Asp.net
Return to Discussion Forum
Post New Message
Category:
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Active Members
Today
Prachi Kulkarn...
(37)
Hemanth
(25)
Prasad kulkarn...
(25)
Last 7 Days
Naved Hasan ...
(255)
naveensanagase...
(230)
Pawan Awasthi
(176)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
Talk to Webmaster Tony John