将数组或数据表或IList分配给隐藏字段 [英] Assign Array or Datatable or IList to hidden field
本文介绍了将数组或数据表或IList分配给隐藏字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Session变量存储值.现在,我将这些会话值转换为隐藏字段.对于用户名或密码之类的单个值,我可以将其转换.但我想将arraylist,datatable等转换为隐藏字段.
如何将其转换为隐藏字段?
除了将列表存储到隐藏字段之外,还有什么更好的解决方案,以便我可以将这些值用于下一页.
谢谢
sjs
Hi,
I am using Session variables for storing the values. Now I am converting these session values to hidden field. For single values like username or password it is fine me to convert it. but I want to convert arraylist,datatable etc to hidden field.
How can I convert it to hidden field?
Is there any better solution other than storing list to hidden field so that I can use that values to next page.
Thanks
sjs
推荐答案
为什么要向Hiddenfields求援.请改用Viewstate.它内部使用隐藏变量,您可以存储任何可序列化的内容.
Why are you gloing for Hiddenfields. Use Viewstate instead. It internally uses hidden variable, and you can store anything which is serializable.
这篇关于将数组或数据表或IList分配给隐藏字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文