Skills for improving ASP. NET performance
. Use ispostback
. Disable unnecessary session Status
<% @ Page enablesessionstate = "false" %>
Use Server Control
. You can skip server control if not necessary.
You can disable viewstate if not necessary.
. <Asp: DataGrid
Enableviewstate = "false" runat = "server"/>
Disable the entire page: <% @ page enableviewstate = "false" %>
Each Server Control has the viewstate attribute,
. Do not use exception ControlProgramProcess
Try {
Result = 100/num;
}
Catch (exception E)
{
}
Rewrite with if:
If (num = 0)
...
. Disable VB and jscrip Dynamic Data Types
Enter this flag:. <% @ page Language = "VB" strict = "true" %>
Because ASP. NET is compatible with ASP
. Access using Stored Procedure data
Do not use dataset for read-only data access.
. Use sqldatareader instead of Dataset
. Sqldatareader is read0-only, forward-only
Disable ASP. NET debug mode
. Use ASP. net output cache to buffer data
. Page Buffer
The combination of buffer parameters, multiple parameters will increase in the geometric level. If the following varybyparam = "NONE"
. Add <% @ outputcatche duration = 60 varybyparam = "textbox1" %> to the top of the page.
. Duration
. Varybyparam
. Fragment buffer (add the outputcache above in usercontrol, that is, the fragment buffer), but add
Another possibility of an error (one controlling two instances) is required.
. Varybycontrol
. Data Buffer
In aplication, session, and cache.
. Expiration dependency Condition
Cache. insert ("mydata", source, new cachedependency (server. mappath ("myauthor. xml ")));
Absolute:
Cache. insert ("mydata", source, null,
Datetime. Now. addhours (10, timespan. Zero );
Relative :...