what are partial classes and their use?

Answer Posted / dasharatham

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 ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give a few examples of page life cycle events.

671


What is a session http?

519


Define tracing.

627


I am trying to implement sorting facility from client side code in GridView Control. So how can I fill up an Array inside client side code (using JavaScript), i want to assign my DataSet object declared and filled up on Server side(in code behind) to the array (on client side)

1490


Explain the difference between Web Garden and Web Farm?

548






Why do we need url encoding?

523


Can you explain the importance of finalize method in .net?

588


Where the assembly is stored in asp.net?

552


What do you mean by serialize?

549


What is the difference between CLICK and MOUSE DOWN Event ?

586


Is asp.net and .net same?

540


What is Pre-Render event in ASP.NET?

591


What is the state management in asp.net?

549


Explain the difference between value type and reference type?

261


IN an ASP.NET Web application if there is any error, how can you debug?

582