what are partial classes and their use?



what are partial classes and their use?..

Answer / 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

More ASP.NET Interview Questions

How would you create a permanent cookie?

0 Answers  


Explain what is clr?

0 Answers  


Hi..I have created a website in Asp.net with C# i want to add Chinese language in my website..could any body tell me that how can i add dynamically this language on user's request...??? thanks n advance...

1 Answers  


How do you do validations. Whether client-side or server-side validations are better.?

5 Answers   Microsoft,


Difference between server.Execute and response.redirect ?

5 Answers   Accenture, Keane India Ltd,






To bind columns manually which tags do you need to add within the asp:datagrid ?

0 Answers   Siebel,


what is webservices. howit is use in our project .

1 Answers   Patni,


How can you handle errors in Web API?

0 Answers  


when u enter the data in one text box once u completed entering the text box data then one page has to be popuped and the text has to be displayed in the parent page

1 Answers  


Is asp.net a programming language?

0 Answers  


Is overloading possible in web services?

2 Answers   Microsoft,


Why we use asp.net for website development?

0 Answers  


Categories