ASP.NET INTERVIEW QUESTIONS

1. When was ASP.NET released?
ASP.NET is a part of the .NET framework which was released as a software platform in
2002
2. Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple
namespaces in a single application code, grouped based on the identifiers’ use. The name of
any given identifier must appear only once in its namespace.
3. List the types of Authentication supported by ASP.NET.
o Windows (default)
o Forms
o Passport
o None (Security disabled)
4. What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution
of .NET code and provides services like memory management, debugging, security, etc. The
CLR is also known as Virtual Execution System (VES).
5. List the various stages of Page-Load lifecycle.
o Init()
o Load()
o PreRender()
o Unload()
6. Explain Web Services.
Web services are programmable business logic components that provide access to
functionality through the Internet. Standard protocols like HTTP can be used to access
them. Web services are based on the Simple Object Access Protocol (SOAP), which is an
application of XML. Web services are given the .asmx extension.
7. What is Postback?
When an action occurs (like button click), the page containing all the controls within the
tag performs an HTTP POST, while having itself as the target URL. This is
called Postback.
8. Explain the differences between server-side and client-side code?
Server side scripting means that all the script will be executed by the server and interpreted
as needed. Client side scripting means that the script will be executed immediately in the
browser such as form field validation, clock, email validation, etc. Client side scripting is
usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone
can see the code by viewing the page source. It also poses as a possible security hazard for
the client computer.
9. Describe the difference between inline and code behind.
Inline code is written along side the HTML in a page. There is no separate distinction
between design code and logic code. Code-behind is code written in a separate file and
referenced by the .aspx page.
10. List the ASP.NET validation controls?
o RequiredFieldValidator
o RangeValidator
o CompareValidator
o RegularExpressionValidator
o CustomValidator
o ValidationSummary
11. What is Data Binding?
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to
the controls on a web form. The values from the dataset are automatically displayed in the
controls without having to write separate code to display them.
12. Describe Paging in ASP.NET.
The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging
property of the DataGrid can be set to True to perform paging. ASP.NET automatically
performs paging and provides the hyperlinks to the other pages in different styles, based on
the property that has been set for PagerStyle.Mode.
13.What is the difference between Server.Transfer and Response.Redirect?
o Response.Redirect: This tells the browser that the requested page can be
found at a new location. The browser then initiates another request to the new
page loading its contents in the browser. This results in two requests by the
browser.
o Server.Transfer: It transfers execution from the first page to the second page
on the server. As far as the browser client is concerned, it made one request and
the initial page is the one responding with content. The benefit of this approach is
one less round trip to the server from the client browser. Also, any posted form
14. What namespaces are imported by default in ASPX files?
The following namespaces are imported by default. Other namespaces must be imported
manually using @ Import directives.
o System
o System.Collections
o System.Collections.Specialized
o System.Configuration
o System.Text
o System.Text.RegularExpressions
o System.Web
o System.Web.Caching
o System.Web.Security
o System.Web.SessionState
o System.Web.UI
o System.Web.UI.HtmlControls
o System.Web.UI.WebControlsariables
15.What is ViewState?
ViewState allows the state of objects (serializable) to be stored in a hidden field on the
page. ViewState is transported to the client and back to the server, and is not stored on the
server or any other external source. ViewState is used the retain the state of server-side
objects between postabacks.

No comments: