in Education by

What are partial classes?

1 Answer

0 votes
by
A partial class is only used to split the definition of a class in two or more classes in the same source code file or more than one source file. You can create a class definition in multiple files, but it will be compiled as one class at run time. Also, when you create an instance of this class, you can access all the methods from all source files with the same object.
 
Partial Classes can be created in the same namespace. It isn't possible to create a partial class in a different namespace. So use the “partial” keyword with all the class names that you want to bind together with the same name of a class in the same namespace. Let’s see an example:
 
ASP.NET  
 

Related questions

0 votes
    What are sealed classes in C#?...
asked Mar 31, 2021 in Education by JackTerrance
0 votes
    What are partial classes in C#?...
asked Jul 9, 2021 in Technology by JackTerrance
0 votes
    What are the WPF Content Controls?...
asked Apr 9, 2021 in Education by JackTerrance
0 votes
0 votes
0 votes
0 votes
    What are master pages?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What are the Navigations techniques in ASP.NET?...
asked Apr 8, 2021 in Education by JackTerrance
0 votes
    What are the differences between ASP.NET HttpHandler and HttpModule?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What are different methods of session maintenance in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What are the authentication modes in ASP.NET for security?...
asked Apr 7, 2021 in Education by JackTerrance
0 votes
    What are the HTML server controls in ASP.NET?...
asked Apr 7, 2021 in Education by JackTerrance
...