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

How do you design a website with multilingual support in ASP.NET ?

542


Explain the difference between asp.net mvc and asp.net webforms? : asp.net mvc

525


How do I force the dispose method to be called automatically, as clients can forget to call dispose method?

503


What are query strings used for?

529


What is the difference between Hash table and Array list?

369






Is asp.net is a programming language?

487


Explain what is viewstate?

541


Differentiate between a hyperlink control and a linkbutton control.

550


What is the full meaning of asp.net?

524


Are there resources online with tips on asp to asp.net conversions?

539


What is the difference between the response.write() and response.output.write() methods?

507


Define cookie.

564


What is authentication in asp.net?

562


What is the use of response redirect in asp.net?

574


Is asp.net still used?

491