- Rongsen.Com.Cn 版权所有 2008-2010 京ICP备08007000号 京公海网安备11010802026356号 朝阳网安编号:110105199号
- 北京黑客防线网安工作室-黑客防线网安服务器维护基地为您提供专业的
服务器维护
,企业网站维护
,网站维护
服务 - (建议采用1024×768分辨率,以达到最佳视觉效果) Powered by 黑客防线网安 ©2009-2010 www.rongsen.com.cn
作者:黑客防线网安ASP维护基地 来源:黑客防线网安ASP维护基地 浏览次数:0 |
atagridsortcommandeventargs e) {
datagrid1.currentpageindex = 0;
sortfield = e.sortexpression;
bindgrid();
}
</script>
下面是上述两个代码段中引用的 testdata.xml 的代码:
<?xml version="1.0" standalone="yes"?>
<newdataset>
<table>
<pub_id>0736</pub_id>
<pub_name>new moon books</pub_name>
<city>boston</city>
<state>ma</state>
<country>usa</country>
</table>
<table>
<pub_id>0877</pub_id>
<pub_name>binnet & hardley</pub_name>
<city>washington</city>
<state>dc</state>
<country>usa</country>
</table>
<table>
<pub_id>1389</pub_id>
<pub_name>algodata infosystems</pub_name>
<city>berkeley</city>
<state>ca</state>
<country>usa</country>
</table>
<table>
<pub_id>1622</pub_id>
<pub_name>five lakes publishing</pub_name>
<city>chicago</city>
<state>il</state>
<country>usa</country>
</table>
<table>
<pub_id>1756</pub_id>
<pub_name>ramona publishers</pub_name>
<city>dallas</city>
<state>tx</state>
<country>usa</country>
</table>
<table>
<pub_id>9901</pub_id>
<pub_name>ggg&g</pub_name>
<city>muenchen</city>
<country>germany</country>
</table>
<table>
<pub_id>9952</pub_id>
<pub_name>scootney books</pub_name>
<city>new york</city>
<state>ny</state>
<country>usa</country>
</table>
<table>
<pub_id>9999</pub_id>
<pub_name>lucerne publishing</pub_name>
<city>paris</city>
<country>france</country>
</table>
</newdataset>
选择会话状态还是 viewstate?
在某些情况下,将状态值保存在 viewstate 中并不是最佳选择,最常用的替代方法就是会话状态,他通常更适用于:
大量的数据。由于 viewstate 增加了发送到浏览器的页面的大�。╤tml 有效负载),同时也增加了回传的窗体的大小,因此不适合存储大量数据。
未在 ui 中显示的安全数据。尽管 viewstate 数据已被编码,并且能选择对其进行加密,但始终不将数据发送到客户端才是最安全的。因此,会话是更安全的选择。(由于数据库需要额外的凭据进行验证,因此将数据存储在数据库中会更安全。能添加 ssl 以获得更安全的链接。)不过,如果在 ui 中已显示了该专用数据,那么你应该已确认了链接的安全性。在这种情况下,将同样的值放入 viewstate 不会降低安全性。
尚未序列化到 viewstate 中的对象,如 dataset。viewstate 序列化程式只为一小部分常用的对象类型进行了优化,如下所示。其他可序列化的类型或许能保留在 viewstate 中,但速度会变慢,并会生成一个非常大的 viewstate。
会话状态 viewstate
是否使用服务器资源? 是 否
是否超时? 是,20 分钟后(默认) 否
是否存储所有 .net 类型? 是 否,仅支持:str
0 顶一下0 踩一下 |
我要申请本站:N点 | 黑客防线官网 | |
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479 |