Hi friends,
I want know what is partial class in C#?
thank you.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted May 7, 2012, 5:46 PM EDT
Please refer the below links
http://www.c-sharpcorner.com/uploadfile/puranindia/partial-classes-in-C-Sharp/default.aspx
http://www.c-sharpcorner.com/uploadfile/abhikumarvatsa/partial-classes-in-C-Sharp/default.aspx
http://www.dotnetperls.com/partial
http://msdn.microsoft.com/en-us/library/wa80x488%28v=vs.80%29.aspx
http://www.devx.com/dotnet/Article/22603
Thanks
SenthilkumarRank #387 · 6.5K reputationPosted May 7, 2012, 6:59 PM EDT
The Partial class concept has introduced in visual studio 2005 onwards. A class can be divided into multiple class, which will be compiled as single class at the time of execution. The physical group of files which has the same name with partial keyword will be combined logically at the execution time.
It allows the large files can be divide into multiple files. All the variables and methods can be called across the partial pages.
A different developers can work on different files.
For example,
Jignesh TrivediRank #16 · 50.3K reputationPosted May 7, 2012, 7:35 PM EDT
Partial class is a new feature added to C# 2.0. Partial classes span multiple files.
It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all parts are combined when the application is compiled.
When working on large projects, spreading a class over separate files allows multiple programmers to work on it simultaneously.
example:
File1.cs
public partial class Employee
{
public void DoWork()
{
}
}
file2.cs
public partial class Employee
{
public void GoToLunch()
{
}
}
please refer
http://msdn.microsoft.com/en-us/library/x9fsa0sw.aspx
hope this help.