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 difference between asp.net and asp?

757


Explain the procedure to handle the process request using mhpm events fired? : asp.net mvc

753


Define viewstate in .net?

731


What is HTTPModule and HTTPcontext? What is the use of each?

2211


What is anonymous authentication?

800


Explain the difference between webfarm and webgardens in .net?

732


Name some asp objects?

761


How can we create a website?

723


Explain in what order a destructors is called.

791


What are cookies in your browser?

717


Does web services support data reader like pom project?

700


How do sessions work?

708


what is command line compiler.what are the steps and how it is related to debugging.

1616


What is asp.net futures?

756


How to integrate angular 8 with asp.net mvc 5? : Asp.Net MVC

662