Home
ASP.Net
Interview FAQs

Use
Response.Write(Request.Browser.Browser.ToString());
Response.Write(Request.Browser.Version.ToString());
Use
string versionNumber = Environment.Version.Major.ToString() + "." + Environment.Version.Minor.ToString();
Response.Write(versionNumber);
Caching is a technique of storing an in-memory copy of important and much used data/information to improve the performance of any software system. The idea is to place frequently used data in quickly accessed media. The ASP.Net runtime includes a key-value map of CLR objects called cache. This lives with the application and is available via the HttpContext and System.Web.UI.Page. Using cache is to some extent similar to using Session object. You can access items in the cache using an indexer and may control the lifetime of objects in the cache and set up links between the cached objects and their physical sources.
ASP.Net provides two types of caching which complement each other.
1. Output Caching: Output cache stores a copy of the finally rendered HTML page sent to the browser. When the next client requests for this page, the page is not actually run instead the cached copy of the HTML is sent thus saving time.
2. Data Caching: Data cache stores pieces of information like DataTable or DataSet retrieved from a database. Data caching is similar to application state, but it is more server friendly. Because, cache items could be removed from the server memory if it grows large and affects performance. Items can also be set to expire automatically.

The following types of caching are built on these two models.
1. Fragment caching: instead of caching the entire HTML page, you can cache a portion of it
2. Data source caching: this is built into the data source controls likeā€”the SqlDataSource, ObjectDataSource and XmlDataSource. You need to configure the appropriate properties and the data source control manages the caching storage and retrieval.

There is no difference, except one assumes a scope. At run time, the Eval method calls the Eval method of the DataBinder object, referencing the current data item of the naming container. The naming container is generally the smallest part of the data-bound control that contains a whole record, such as a row in a GridView control. You can therefore use the Eval method only for binding inside templates of a data-bound control.

So the difference is Eval chooses the Container to bind against, while DataBinder.Eval lets you bind against anything.

Eval() this can be used only when you work with inline binding. i.e. when you use it in ASPX page. This wont work in code behind.

DataBinder.Eval() can be used in code behind as well as inline.

DataBinder.Eval takes 2 or 3 arguments. The first arg is the data object to bind to. In the case of DataGrid, DataList and Repeater, Container.DataItem is the single row. The second arg the string name of the field from the data object you which to display. DataBinder.Eval uses these two pieces of information to work out the rest of the expression syntax.

It is the time taken to process a request. This is measured as the time elapsed between the first byte received from the server and the last one.
It is the time between issuing a request and the first byte received as a response from the server.
PreviousDisplaying 26 of 46Next
Need Help? Contact Us.

Log in

*
*

Forgot password?

*

New User

*
*
*
*