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
What is entity framework? : Entity framework
What are the levels at which filters can be applied in an asp.net mvc application?
Can you explain the page life cycle of mvc?
What is the use of display modes?
What is the difference between entity framework and mvc?
What is the meaning of unobtrusive javascript?
Mention what is the difference between “ActionResult” and “ViewResult” ?
What is asp net framework?
When using aspx view engine, to have a consistent look and feel, across all pages of the application, we can make use of asp.net master pages. What is asp.net master pages equivalent, when using razor views?
What is the importance of NonActionAttribute?
What are advantages of Dependency Injection (DI) in ASP.Net MVC?
What is entity framework in asp net?
How does servicing work for the .net framework 3.0?
Which are the important namespaces used in ASP.Net MVC?
What is the greatest advantage of using asp.net mvc over asp.net webforms?