what are partial classes and their use?

Answer Posted / alb.shah

This is a feature of 2005,when we have large and unwildly
classes instead of writing all the methods in same program
we will divide the class into number of programs with the
same class name,these classes are preceeded with partial
keyword,when we compile all this partial classes only one
dll with the same class name will be created.


class with some 20 methods:
Example.cs
class classA{
m1( );
m2( );
.
.
.
m20( );
}

Apply partial concept:

Example1.cs
partial class classA
{
m1( );
m2( );
.
.
m8( );
}
example2.cs
partial class classA
{
m9( );
m10( );
.
.
m15( );
}
Example3.cs
partial class classA
{
m16( );
.
.
m20( );
}

if we compile Examle1.cs,Example2.cs,Example3.cs it will
create only one dll

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is simple data binding?

513


Explain server control extensibility with reference to asp.net 2.0 ?

537


How do we assign page-specific attributes?

611


Is it possible to migrate visual interdev design-time controls to asp.net?

559


What are server objects?

511






What is client side state management?

500


What is asp.net and how it works?

513


What is enableviewstate in asp net?

518


Can more than one person use the same login?

570


how to debug web services on consumer side?

570


Is asp.net 64-bit enabled? How?

577


What is asp according to you?

526


Define repository pattern in asp.net mvc? : asp.net mvc

492


What is the mvc model?

575


What is the difference between custom web user control and a custom web server control?

497