what are partial classes and their use?
Answers were Sorted based on User's Feedback
This is a feature of 2005,when we have large and unwildly
classes instead of writing all the methods in same program
we will divide the class into number of programs with the
same class name,these classes are preceeded with partial
keyword,when we compile all this partial classes only one
dll with the same class name will be created.
class with some 20 methods:
Example.cs
class classA{
m1( );
m2( );
.
.
.
m20( );
}
Apply partial concept:
Example1.cs
partial class classA
{
m1( );
m2( );
.
.
m8( );
}
example2.cs
partial class classA
{
m9( );
m10( );
.
.
m15( );
}
Example3.cs
partial class classA
{
m16( );
.
.
m20( );
}
if we compile Examle1.cs,Example2.cs,Example3.cs it will
create only one dll
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / vikas kant
Partial Class is the class whose definition is present in
two or more files.All these files combined with each other
at the compile time.
e.g :---
public partial class Employee
{
public void DoWork()
{
}
}
public partial class Employee
{
public void GoToLunch()
{
}
}
so while using the partial classes coders can work in
different files and at compile time all the code can be
combined.it saves the time and also provides the better
security bcoz code is present in more than one file.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / arunajyothi.m
“partial” keyword can be used to split a single class,
interface, or struct into multiple, separate files in
ASP.NET (using C# as the language). This permits multiple
developers to works on these files, which can later be
treated as a single unit by the compiler at the time of
compilation and compiled into MSIL code.
1.Partial classes can improve code readability and
maintainability by providing a powerful way to extend the
behavior of a class and attach functionality to it.
2.The partial modifier can only appear immediately before
the keywords class, struct, or interface.
3.Nested partial types are allowed in partial-type
definitions.
4.Using partial classes helps to split your class
definition into multiple physical files.
5.Note that the partial keyword applies to classes,
structs, and interfaces, but not enums
| Is This Answer Correct ? | 3 Yes | 4 No |
How to you can limit Access to Web API to Specific HTTP Verb?
What base class do all Web Forms inherit from?
Explain the difference between dataset and datareader.
Explain the function of new view engine in asp.net? : asp.net mvc
What is autopostback in asp net?
what is diffrent between asp & asp.net
What namespaces are imported by default in ASMX files?
What is marshalling ? Is it a part of asp.net ?
Is asp.net core faster?
How to manage different kinds of sessions in ASP.NET?
i develop a web application and i gave security setting i.e autherization and athentication now it work properly on my local system , now question is ,is this security setting ie autherization and athentication which i gave in web.config will it be enough strong to secure my application on internet or i have to use some 3rd party tool or software to get security .if yes --how ? if no--what is the alternate?
Is asp.net different from asp? If yes, explain how?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)