Breaking News
Loading...
Thursday 30 May 2013

ASP .NET Interview Questions and Answers 5

00:15
61. What do you understand by aggregate dependency?

Aggregate dependency allows multiple dependencies to be aggregated for content that depends on more than one resource. In such type of dependency, you need to depend on the sum of all the defined dependencies to remove a data item from the cache.

62. How can you ensure that no one has tampered with ViewState in a Web page?

To ensure that no one has tampered with ViewState in a Web page, set the EnableViewStateMac property to True.

63. What is the difference between adding items into cache through the Add() method and through the Insert() method?

Both methods work in a similar way except that the Cache.Add() function returns an object that represents the item you added in the cache. The Cache.Insert() function can replace an existing item in the cache, which is not possible using the Cache.Add() method.

64. Explain the cookie less session and its working.

ASP.NET manages the session state in the same process that processes the request and does not create a cookie. It is known as a cookie less session. If cookies are not available, a session is tracked by adding a session identifier to the URL. The cookie less session is enabled using the following code snippet: <sessionState cookieless="true" />

65. 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.

66. What are the major built-in objects in ASP.NET?

The major built-in objects in ASP.NET are as follows:
  •     Application
  •     Request
  •     Response
  •     Server
  •     Session
  •     Context
  •     Trace

67. Where should the data validations be performed-at the client side or at the server side and why?

Data validations should be done primarily at the client side and the server-side validation should be avoided because it makes server task overloaded. If the client-side validation is not available, you can use server-side validation. When a user sends a request to the server, the validation controls are invoked to check the user input one by one.

68. Why do we need nested master pages in a Web site?

When we have several hierarchical levels in a Web site, then we use nested master pages in the Web site.

69. How can you dynamically add user controls to a page?

User controls can be dynamically loaded by adding a Web User Control page in the application and adding the control on this page.

70. What is the appSettings Section in the web.config file?

The web.config file sets the configuration for a Web project. The appSettings block in configuration file sets the user-defined values for the whole application.

For example, in the following code snippet, the specified ConnectionString section is used throughout the project for database connection:

<configuration>
<appSettings>
<add key="ConnectionString" value="server=indiabixserver; pwd=dbpassword; database=indiabix"/>
</appSettings>

71. What type of code, client-side or server-side, is found in a code-behind file of a Web page?

A code-behind file contains the server-side code, which means that the code contained in a code-behind file is executed at the server.

72. To which class a Web form belongs to in the .NET Framework class hierarchy?

A Web form belongs to the System.Web.UI.Page class.

73. What does the "EnableViewState" property do? Why do we want it On or Off?

The EnableViewState property enables the ViewState property on the page. It is set to On to allow the page to save the users input between postback requests of a Web page; that is, between the Request and corresponding Response objects. When this property is set to Off, the page does not store the users input during postback.

74. Which event determines that all the controls are completely loaded into memory?

The Page_Load event determines that all the controls on the page are fully loaded. You can also access the controls in the Page_Init event; however, the ViewState property does not load completely during this event.

75. What is the function of the CustomValidator control?

It provides the customize validation code to perform both client-side and server-side validation.


Share This :
Tags:

0 comments:

Post a Comment

 
Toggle Footer