_.NET概论及软件使用_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

A.NET ViewState初探(4)

作者:黑客防线网安ASP维护基地 来源:黑客防线网安ASP维护基地 浏览次数:0

本篇关键词:table>city>/city>数据

    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 &amp; 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&amp;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

 


    希望这篇A.NET ViewState初探(4)的文章能够对您有所帮助,如果您觉得这篇网站维护教程有用的话,别忘了推荐给您的朋友哦!如果您有好的经验方法,不妨拿出来和大家一起分享:假如每个人都拿出一个经验,那么我们都将额外的获取一堆他人的经验。
请记住本站永久域名:(黑客防线网安服务器维护方案维护基地)Www.Rongsen.Com.Cn
    黑客防线网安服务器维护方案本篇连接:http://shop.rongsen.com.cn/show-14183-1.html
网站维护教程更新时间:2012-03-30 05:29:51  【打印此页】  【关闭
0
顶一下
0
踩一下
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer