码迷,mamicode.com
首页 > Web开发 > 详细

ASP.NET 页面基本优化.

时间:2016-01-26 12:21:50      阅读:827      评论:0      收藏:0      [点我收藏+]

标签:

一、禁用Browser Link(目前主要用来是刷新vs ide 浏览界面),直接干掉。

<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
    {"appName":"Chrome","requestId":"cddf6a41e4d644e7ab92867e44047b01"}
</script>
<script type="text/javascript" src="http://localhost:3569/15be439c39274b44a7156b2a0dbb1b46/browserLink" async="async"></script>
<!-- End Browser Link -->

禁用方法:添加配置节

<appSettings>
    <add key="vs:EnableBrowserLink" value="false" />
</appSettings>

二、禁用页面中大量的asp.net hidden值(主要是viewstate使用,禁用以后无法使用viewstate)。

技术分享
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="sxv4uj63h/qAPN2FObQNiqKcKgU3uq0kmcXwCGQjDAlgS7GhNbAAGSGKOyAgSt1n+lmh6N4V6KfZqGwGmMENoGVJ7VnmgcMPu/OFJ2FOXwxunIl/ZE/2kEhHefV4nMEYfLVZtPEyFwKmrSek3J1dbVWMV5jU7R6vHzzP/RFQR6FJAhwK/nkD8WJuNol5YX3wTDWYLamdfKSl2kHmI2kIjRbhQKj7Y9J7CW92BD5htTOwAKlxM5vctEQ9vigngK2yG/TMKipE++yWtbogYdswQuqsXiEmliTYJt0PrSQgN9Bf2QryKt47V5gLEGozCoCBd8SZXfWYky52Tdq9ZoGxWDhmHnnr7VBs/oMqu7zihLKj4OtMwmeCqRgta3mhljRAcB6A57B1EJ9NqWZxwRmSBVWW1ZkqiMD+3WINi5Em4Z/NDSzLLev3lpUU6EMFDvRImFUpSZzXYdqsJ2B6nMbOsSAaIflku9VTb0DRPTURB7bRSpLpgz7xcIBSnRh1ozcmSvcniEeXz8e7e7FUZAhgNqL4aneUINL1T4eGm/ZhEU3RH8HRFwpnOrYC0XUaB037xAK8dn5NNEEkqFFK9eYKH6G+POZBztpRxqbDSDh3JgDjL6I6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PnJmYZLXkt/wzMBRxjvfoHTHi7Rs7uD96OBM1us0JyJ7nIUlJ4z7cdGNDvtY4YZBQtCtzHlKYlOzIntKlpRZtxm/opBi7pWnkdORZKHvS0uJlAF6D3bWKrfZsi5XLvWnuFY38prOdQZeSJHxRIOf3iAmn2GKrr/DkzIHz/4" />
</div>
View Code

禁用方法有两点:

1.

<system.web>
<pages enableViewState="false"/>
</system.web>

2. 删除页面中的form服务器控件.

三、移除网站中一些不适用的模块。

如:

 <httpModules>
      <remove name="RoleManager"/>
      <remove name="PassportAuthentication"/>
      <remove name="Profile"/>
      <remove name="ServiceModel"/>
      <remove name="WindowsAuthentication"/>
      <remove name="FileAuthorization"/>
      <remove name="FormsAuthentication"/>
</httpModules>

 

ASP.NET 页面基本优化.

标签:

原文地址:http://www.cnblogs.com/eastday/p/5159493.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!