代码改变世界

提高asp.net应用程序性能技巧

2007-04-08 11:12  ruinet  阅读(218)  评论(0编辑  收藏  举报
1避免不必要的操作 Page_Load和IsPostBack
  使用IsPostBack判断是否是回传,并在处理代码
2 关闭不必要的Session 状态
<%@ Page EnableSessionState="False" %>

3 尽量少使用Server Control,能用html 控件,而不要使用Server control

4 不必要是可以关闭ViewState
 <asp:GridView ID="GridView2" runat="server" EnableViewState="False">
                    </asp:GridView>
<%@ Page EnableViewState ="false" %>关闭整个页面的ViewState
5 只读数据访问时不要使用DataSet,使用SqlDataReader代替DataSet

6关闭asp.net 的debug模式

7 使用asp.net 的OutPut Cache的数据缓冲



free web counter