Learning ASP. NET (4): taking notes for online training

Source: Internet
Author: User

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 :...

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.