Friday 6 June 2014

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.

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.

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

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.

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" />

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.

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.

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.

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

In which database is the information, such as membership, role management, profile, and Web parts personalization, stored?

The aspnetdb database stores all information.