Breaking News
Loading...
Thursday 30 May 2013

ASP .NET Interview Questions and Answers 7

04:50
91. How many types of Cookies are available in ASP.NET?

There are two types of Cookies available in ASP.NET:

    Session Cookie - Resides on the client machine for a single session until the user does not log out.
    Persistent Cookie - Resides on a user's machine for a period specified for its expiry, such as 10 days, one month, and never.

The user can set this period manually.

92. What is the use of the Global.asax file?

The Global.asax file executes application-level events and sets application-level variables.

93. What are the Culture and UICulture values?

The Culture value determines the functions, such as Date and Currency, which are used to format data and numbers in a Web page. The UICulture value determines the resources, such as strings or images, which are loaded for a Web page in a Web application.

94. What is the difference between ASP session and ASP.NET session?

ASP does not support cookie-less sessions; whereas, ASP.NET does. In addition, the ASP.NET session can span across multiple servers.

95. Which control will you use to ensure that the values in two different controls match?

You should use the CompareValidator control to ensure that the values in two different controls match.

96. What is the difference between a page theme and a global theme?

A page theme is stored inside a subfolder of the App_Themes folder of a project and applied to individual Web pages of that project. Global themes are stored inside the Themes folder on a Web server and apply to  all the Web applications on the Web server.

97. What do you mean by a neutral culture?

When you specify a language but do not specify the associated country through a culture, the culture is called as a neutral culture.

98. What is the use of the <sessionState> tag in the web.config file?

The <sessionState> tag is used to configure the session state features. To change the default timeout, which is 20 minutes, you have to add the following code snippet to the web.config file of an application: <sessionState timeout="40"/>

99. Can you post and access view state in another application?

Yes, you can post and access a view state in other applications. However, while posting a view state in another application, the PreviousPage property returns null.

100. Which method do you use to kill explicitly a users session?

The Session.Abandon() method kills the user session explicitly.

101. Which class is inherited when an ASP.NET server control is added to a Web form?

The System.Web.UI.WebControls class is inherited when an ASP.NET server control is added to a Web form.

102. What events are fired when a page loads?

The following events fire when a page loads:
  •     Init() - Fires when the page is initializing.
  •     LoadViewState() - Fires when the view state is loading.
  •     LoadPostData() - Fires when the postback data is processing.
  •     Load() - Fires when the page is loading.
  •     PreRender() - Fires at the brief moment before the page is displayed to the user as HTML.
  •     Unload() - Fires when the page is destroying the instances of server controls.

103. Write three common properties of all validation controls.

Three common properties of validation controls are as follows:
  •     ControlToValidate - Provides a control to validate
  •     ErrorMessage - Displays an error message
  •     IsValid - Specifies if the control's validation has succeeded or not
  •     Text - Displays a text for validation control before validation
104. What are navigation controls? How many navigation controls are there in ASP.NET 4.0?

Navigation controls help you to navigate in a Web application easily. These controls store all the links in a hierarchical or drop-down structure; thereby facilitating easy navigation in a Web application.
There are three navigation controls in ASP.Net 4.0.
  •     SiteMapPath
  •     Menu
  •     TreeView
105. What happens if an ASP.NET server control with event-handling routines is missing from its definition?

The compilation of the application fails.


Share This :
Tags:

0 comments:

Post a Comment

 
Toggle Footer