Can we have more than 1 partial classes in the same file?
Answer Posted / mahesh kotekar
It is possible to have partial class in same class file.
Partial Class Concept was used in dotnet to provide
practically dividing the class into two or multiple physical
files. In order to keep the complexity of class
simple.During compilation the partial classes join together
to form a single class and works as normal class
partial class First
{
public static void DoSomething1()
{
Console.WriteLine("Executing from First Part of
Class First");
}
}
partial class First
{
public static void DoSomething2()
{
Console.WriteLine("executing from second part of
class First");
}
}
| Is This Answer Correct ? | 9 Yes | 0 No |
Post New Answer View All Answers
Is .net framework going away?
How to make sure Client Validation is enabled in ASP.Net MVC
Can I add asp.net mvc testcases in visual studio express?
what is code first approach?
What are html helpers in asp.net mvc?
Explain bundle.config in mvc4?
What are the new features 3.5 framework against with the tool?
What is namespace of asp.net mvc?
What does a viewmodel do?
What are the levels at which filters can be applied in an asp.net mvc application?
What is the use of razor view engine?
Explain .Net Framework? Why we use it?
How we can invoke child actions in ASP.Net MVC?
What is routeconfig.cs in mvc 4?
Explain tempdata in mvc?