I
am explain about interview question of dot net. I attend multiple interview
where interviewer ask question to me. Here I am a question with answer of the
question.
Q
: What is Postback? Why we use it ?
Ans.
Postback we use send data request to server.
Q
: Tell about Viewstate ?
Ans.
Viewstate maintains the Postback.
Q:
Define the default session timeout?
Ans.
I told him the default session timeout is 20 min.
Q:
Where need to use Interface and abstract class? Difference some between both ?
Ans.
Interface class we use that we didn’t about implement we just have requirement
specification. As Abstract class we know about implementation but half
implementation not complete then we use each both.
1 1) Interface
we declare the variable with initialization but Abstract not restriction of
initialization without initialization we declare a variable.
2 2) Construction are
not allow in interface class. Abstract class full support construction concept.
Q: What is a
difference between encapsulation and abstraction ?
Encapsulation
:
Encapsulation
class hiding the complexity. Private the code didn’t show actually what
user need they don’t the behind of the
application. Actually implement the abstraction class.
Abstraction:
Abstraction
class showing the necessary in the designing side what user want in front side.
Abstraction class are modeling.
Overloading
method :
Overloading
means two method name are same but
different number of Parameters and Signature.
Overriding
Method :
Overriding
means same the name of parent class method name also same the child class
method name but child full they to redefine parent class method.
Q: Why we
use Polymorphism and what the type of that ?
Ans. Polymorphism are inherit multiple we call it at
different place where are they need.
Type of Polymorphism :
Static Polymorphism (also called Overloading method)
Dynamic Polymorphism(Also
called overriding method)
Q : Tell
about ViewBag, ViewData, TempData and also in MVC ?
ViewBag :
ViewBag are
the collection of ViewData. It is dynamically take value and also send data
controller to View. We without declare
with parameters of square bracket example below.
ViewBag.testdata
= “ This is test data”;
ViewData :
ViewData[“testdata”]
= “This is test data”;
TempData :
Tempdata
data send controller to controller not in View. It is also declare of same of
ViewData like Square parameters. Example below
TempData[“testdata”]
= “this is test data”;
Session
Variable :
Session
Variable we use every where like view to controller and controller to
controller.
Q: Explain
between Get and Post in asp.net ?
Get :
Get send the
data to http but it is not secure. Get value show in the address Url. It is benefit
in SEO.
Post:
Post also
send data to http for submitting but it secure. We don’t see the value of Post
in Url of the browser.
Q: Can we
use ViewState in Asp.net MVC in Asp.net ?
Ans. No Asp.net
MVC not Supported ViewState.
Q: Asp.net
C# support multiples Inheritance?
Ans. No C#
didn’t supported multiples inheritance.
No comments:
Post a Comment