1.In which event are the controls fully loaded?
Page load event guarantees that all controls are fully
loaded. Controls are also accessed in Page_Init events but you will see
that view state is not fully loaded during this event
2.What is the difference between a default skin and a
named skin?
The default skin is applied to all the Web server controls in a Web form,
which are of similar type, and it does not provide a Skin ID attribute. The
named skin provides a Skin ID attribute and users have to set the Skin ID
property to apply it.
3.Which two new properties are added in ASP.NET 4.0 Page
class?
The two new properties added in the Page class are
MetaKeyword and
MetaDescription.
4.What is the difference between authentication and authorization?
Authentication verifies the identity of a user and authorization is a
process where you can check whether or not the identity has access rights to
the system. In other words, you can say that authentication is a procedure of
getting some credentials from the users and verify the user's identity against
those credentials. Authorization is a procedure of granting access of
particular resources to an authenticated user. You should note that
authentication always takes place before authorization.
5.Which ASP.NET objects encapsulate the state of the
client and the browser?
The
Session object encapsulates the state of the client and browser.
6.Differentiate globalization and localization.
The globalization is a technique to identify the specific part of a Web
application that is different for different languages and make separate that
portion from the core of the Web application. The localization is a procedure
of configuring a Web application to be supported for a specific language or
locale
.
7.Which method has been introduced in ASP.NET 4.0 to
redirect a page permanently?
The
RedirectPermanent() method added in ASP.NET 4.0 to redirect a
page permanently. The following code snippet is an example of the
RedirectPermanent()
method:
RedirectPermanent("test.aspx");
8.What is the difference between the Response.Write()
and Response.Output.Write() methods?
The
Response.Write() method allows you to write the normal output;
whereas, the
Response.Output.Write() method allows you to write the
formatted output.
9.What does the Orientation property do in a Menu control?
Orientation property of the Menu control sets the horizontal or vertical
display of a menu on a Web page. By default, the orientation is vertical.
10.What is the default timeout for a Cookie?
The default time duration for a Cookie is 30 minutes.
11.What are HTTP handlers in ASP.NET?
HTTP handlers, as the name suggests, are used to handle user requests for
Web application resources. They are the backbone of the request-response model
of Web applications. There is a specific event handler to handle the request
for each user request type and send back the corresponding response object.
Each user requests to the IIS Web server flows through the HTTP pipeline, which
refers to a series of components (HTTP modules and HTTP handlers) to process
the request. HTTP modules act as filters to process the request as it passes
through the HTTP pipeline. The request, after passing through the HTTP modules,
is assigned to an HTTP handler that determines the response of the server to
the user request. The response then passes through the HTTP modules once again
and is then sent back to the user.
You can define HTTP handlers in the
element of a
configuration file. The
element tag is used to add new
handlers and the
element tag is used to remove existing
handlers. To create an HTTP handler, you need to define a class that implements
the
IHttpHandler interface.
12.What is the use of PlaceHolder control? Can we
see it at runtime?
The
PlaceHolder control acts as a container for those controls that
are dynamically generated at runtime. We cannot see it at runtime because it
does not produce any visible output. It used only as a container.
13.What is the difference between page-level caching and
fragment caching?
In the page-level caching, an entire Web page is cached; whereas, in the
fragment caching, a part of the Web page, such as a user control added to the
Web page, is cached.
14.Describe the complete lifecycle of a
Web page.
When we execute a Web page, it
passes from the following stages, which are collectively known as Web page
lifecycle:
- Page request
- During this stage, ASP.NET makes sure the page either parsed or compiled
and a cached version of the page can be sent in response
- Start
- During this stage sets the Request and Response page properties and the
page check the page request is either a postback or a new request
- Page Initialization
- During this stage, the page initialize and the control's Unique Id
property are set
- Load
- During this stage, if the request is postback, the control properties
are loaded without loading the view state and control state otherwise
loads the view state
- Validation
- During this stage, the controls are validated
- Postback event handling - During this stage, if the request is a postback,
handles the event
- Rendering
- During this stage, the page invokes the Render method to each control
for return the output
- Unload
- During this stage, when the page is completely rendered and sent to the
client, the page is unloaded.
15.What is State Management? How many
ways are there to maintain a state in .NET?
State management is used to store
information requests. The state management is used to trace the information or
data that affect the state of the applications.
There are two ways to maintain a state in .NET, Client-Based state management
and Server-Based state management.
The following techniques can be used to implement the Client-Based state
management:
- View State
- Hidden Fields
- Cookies
- Query Strings
- Control State
The following techniques can be used to implement Server-Based state
management:
- Application State
- Session State
- Profile Properties
16.What is a round trip?
The trip of a Web page from the client to the
server and then back to the client is known as a round trip.
17.What is Role-based security?
In the Role-based security, you can assign a role to every user and grant
the privilege according to that role. A role is a group of principal that
restricts a user's privileges. Therefore, all the organization and applications
use role-based security model to determine whether a user has enough privileges
to perform a requested task.
18.Where is the ViewState information stored?
The
ViewState information is stored in the HTML hidden fields.
19.Explain the AdRotator Control.
The
AdRotator is an ASP.NET control that is used to provide
advertisements to Web pages. The
AdRotator control associates with one
or many advertisements, which randomly displays one by one at a time when the
Web page is refreshed. The
AdRotator control advertisements are
associated with links; therefore, when you click on an advertisement, it
redirects you to other pages.
The
AdRotator control is associated with a data source, which is
normally an xml file or a database table. A data source contains all the
information, such as advertisement graphics reference, link, and alternate
text. Therefore, when you use the
AdRotator control, you should first
create a data source and then associate it with the
AdRotator control.
Can we validate a DropDownList by RequiredFieldValidator?
Yes, we can validate a DropDownList by
RequiredFieldValidator. To
perform this validation, we have to set the
InitialValue property of
RequiredFieldValidator
control.
20.What are the modes of storing ASP.NET session?
-InProc
-StateServer
-SQLServer
21.What
is partial classess in .net?
When there is a need to keep the
business logic separate from the User Interface or when there is some class
which is big enough to have multiple number of developers implement the methods
in it, the class can be separated and written in different files as partial
class.
The keyword partial must appear in
each class.