What is partial classess in .net?

What is partial classes in .net?

When there is a need to keep the business logic separate from the User Interface or when there is some class which is big enough to have multiple number of developers implement the methods in it, the class can be separated and written in different files as partial class.
Partial classes allow us to divide the class definition into multiple files (physically). Logically, all the partial classes are treated as a single file by the compiler.

The keyword partial must appear in each class.
syntax for C#
Public partial class MyPartialClass1
{
    //code
}
// this code could be in file1

Public partial class MyPartialClass1
{
    //code
}
// this code could be in file2
Explain how to pass a querystring from an .asp page to aspx page. - ASP.NET
Explain how to pass a querystring from an .asp page to aspx page. - This html addresses use QueryString property to pass values between pages....
What is a ViewState? - ASP.NET
What is a ViewState? - If a site happens to not maintain a ViewState, then if a user has entered some information in a large form with many input fields and the page is refreshes, then the values filled up in the form are lost...
What is the difference between src and Code-Behind?
What is the difference between src and Code-Behind? - With the ‘src’ attribute, the source code files are deployed and are compiled by the JIT as needed...
Post your comment