积极答复者
关于NetAdvantage中的ultrawebgrid 和触发viewstate的问题

问题
-
在ultrawebgrid中定义一列为:
<igtbl:UltraGridColumn Type="CheckBox" Key="checkBox" AllowUpdate="Yes"> </igtbl:UltraGridColumn>
另外在ultrawebgrid 外加了一个checkbox,作为全选按钮,勾选时会将ultrawebgrid 中的checkbox全选,用jquery
$checkAll.click(function () {
$checkItem.attr('checked', $(this).attr('checked'));实现。
这个Jquery全选功能表面上是实现了,问题是ultrawebgrid 里面的checkbox的状态不能触发viewstate,不能传到页面的cs处理程序中去。
我现在也明白不能触发的原因,但不知道怎么修改才能触发viewstate,期待你们的详细回复!!!!!!!!!
答案
-
Hi ssrivers,
我对这个控件不熟,你为什么要用viewstate呢?这个会增加页面的体积,而且不安全。如果你用jquery去选中所有的checkbox,这个状态只是影响了html。
我想你有2种方式来解决这个问题:
1、你可以用AJAX来提交选中的数据,我想你肯定了解这个技术。
2、不要用jquery,你可以判断上面的一个checkbox的状态(runat server),然后默认选取所有的Item。(我不确定这个方案,因为我不清楚这个控件)。
你应该到ASP.NET 从新开帖问。谢谢!
周末愉快~~
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已建议为答案 Michael Sun [MSFT]Microsoft employee 2011年3月5日 2:36
- 已标记为答案 Tonny Gu 2011年3月7日 2:53
全部回复
-
Hi ssrivers,
我对这个控件不熟,你为什么要用viewstate呢?这个会增加页面的体积,而且不安全。如果你用jquery去选中所有的checkbox,这个状态只是影响了html。
我想你有2种方式来解决这个问题:
1、你可以用AJAX来提交选中的数据,我想你肯定了解这个技术。
2、不要用jquery,你可以判断上面的一个checkbox的状态(runat server),然后默认选取所有的Item。(我不确定这个方案,因为我不清楚这个控件)。
你应该到ASP.NET 从新开帖问。谢谢!
周末愉快~~
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已建议为答案 Michael Sun [MSFT]Microsoft employee 2011年3月5日 2:36
- 已标记为答案 Tonny Gu 2011年3月7日 2:53
-
同意! 建议到ASP.NET论坛发帖求助,
http://social.microsoft.com/Forums/zh-CN/295/threads
Michael Sun [MSFT]
果您对我们的论坛在线支持服务有任何的意见或建议,请通过邮件告诉我们。
立刻免费下载 MSDN 论坛好帮手
-
你好!
我想你对viewstate有些误解,因为网页本来是无状态的,为了保持上一次的网页上的状态,微软发明这种机制,其实你可以用session,cache等等技术来代替。对于所有的服务器控件都是有viewstate!我来看看结构图:
存储只是key与value。ruanat="server" 就会自动的去存储viewstate,但是你也可以设置 EnableViewState=false.来disable 控件的viewstate。
周末越快~~~
Alan Chen[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已建议为答案 Michael Sun [MSFT]Microsoft employee 2011年3月5日 14:47