How to: Enable ASP. NET application tracing
Trace is not enabled in ASP. NET by default. First, add the following node to the configuration file! [If you only need to use Trace on a page, add the Trace to the Page. [<% @ page Language = "C #" Trace = "true" TraceMode = "SortByTime "]
<configuration> <system.web> <trace enabled="true" pageOutput="false" requestLimit="40" localOnly="false"/> </system.web></configuration>
Below I wrote two pages, the database uses the Northwind database
<% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "datasUseGridView. aspx. cs" Inherits = "testWeb. databing. datasUseGridView"EnableViewState= "False"%> <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "datasUseRepeater. aspx. cs "Inherits =" testWeb. databing. datasUseRepeater "EnableViewState =" false "%> <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
How to: Use the tracking viewer to view ASP. NET trace information
Enter http: // localhost: 30194/databing/trace. axd in the address bar. [run trace. axd after the path you run]
Click 1 to View Details [bind data with GridView]
Click "2" to View Details [bind data with Repeater]
0.18248628031112/0.0270457468544523 = 6.747318951596225
Of course, to compare the efficiency of the GridView and Repeater, we need to take the average value for multiple tests. Sometimes I test them very differently and sometimes very small. For example, if we need to compile for the first time, it becomes very slow, it will be faster later! If you are interested, you can test several groups of data!
Technorati label: Trace. axd, gridview, repeater