Reference Page: C-Language|C++|C#|VB.Net|Asp.Net

Asp.Net Links : Learn     Interview Questions     Software IDE Asp.Net Jobs : Indeed.com     ZipRecruiter.com     Monster.com

Asp.Net & WebApi Interview Questions - Page 6

< Previous Page              Next Page >
Question: What are the different validators in Asp.Net?
Answer: Below please find different types of validators in Asp.Net:
Required field Validator: Indicates the input Control is not empty when the form is submitted.
Range Validator: Verifies that the input value falls within a given range of number, date or string.
Compare Validator: Compares the value of one control to another using a comparison operator.
Regular expression Validator: Validates the input text of a control that matches a pattern.
Custom Validator: Allows putting complex validations in place.
Summary Validator: Displays a summary of errors raised by each control on the page

Question: What is ViewState?
Answer: The ViewState in Asp.Net is used to retain state of server-side objects between page post backs. ViewState is stored in a hidden field on page at client-side. ViewState is transported to client and then back to the server. They exist during the life of an Asp.Net page.

Question: What are different Session state management options available?
Answer: Below are the different session state management techniques:
In-Process: It stores the session in memory on web server.
Out-of-Process: It stores data on external server, what can be either SQL Server or State Server. All objects stored in session must be serializable for this.

Question: What is caching?
Answer: Through Caching one can improve performance significantly by keeping frequently accessed data / files in memory. There are three types of caching supported:
Output Caching: Stores response of web request in cache and reuses that in subsequent requests that match certain criteria. It reduces amount of work that web server has to do for each request, like executing code, querying databases, or rendering views.
Fragment Caching: It is used when there comes need to cache only a segment of a page, say contact-us page in a main page will be same for all users, so there is no need to cache the entire page.
Data Caching: Asp.Net supports this by treating data as small sets of objects and storing those objects in memory and use them depending on the need anywhere across page.

Question: What are different techniques for Output Caching in Asp.Net?
Answer: Following are most common types of output caching, depending on where the response is stored and who can access it:
Client-side caching: Here response is stored in the browser's cache. Here caching is controlled by HTTP headers like Cache-Control and Expires, what specifies the time window and conditions for browser to use the cached response.
Proxy caching: Here the response is stored on an intermediate proxy server (CDN) and is reused by multiple clients. Here the caching is controlled by HTTP headers, like ETag, which specifies how the proxy can validate and control the cached response.
Server-side caching: For this type the response is stored on the web server's memory or disk and it is reused by multiple clients. Here caching is controlled by web application logic, that decides what to cache and how to invalidate them.

Question: What is the difference between using Session and Caching?
Answer: A session data is per-user based, but caching is not per-user based. So session data is stored at the user level, but caching data is stored at the application level and shared by all the users.



< Previous Page Next Page >