What is the situation you will need to use partial class in .net

Editorial / Best Answer

Sandhya.Kishan  

  • Member Since Mar-2012 | Mar 12th, 2012


Visual Studio uses partial classes to separate auto-generated code from user-generated code. Example:Let us consider that visual studio creates a file called Form1.Designer.cs which holds the designer-related, auto-generated code. So in both Form1.cs and Form1.Designer.cs the Form1 class is declared as partial and the compiler joins them into one.

Showing Answers 1 - 2 of 2 Answers

Visual Studio uses partial classes to separate auto-generated code from user-generated code.

Example:Let us consider that visual studio creates a file called Form1.Designer.cs which holds the designer-related, auto-generated code. So in both Form1.cs and Form1.Designer.cs the Form1 class is declared as partial and the compiler joins them into one.

  Was this answer useful?  Yes

malik_malik

  • Sep 23rd, 2012
 

when different programmers work on single project and all write a code in class .Every programmer declare this class as Partial class and implement own code at the end of the day this partial class have all functionality that all programmers put in this class.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions