Listview中的checkboxList,在分页后保持选中状态 [英] checkboxList in Listview and remain selected after paging

查看:75
本文介绍了Listview中的checkboxList,在分页后保持选中状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用listview控件并在该checkboxList中。如果我选择任何复选框并转到第二页然后我再回到第一页然后它不会保持选中复选框是真的因为我绑定新数据bur如何保留旧值...? plz help ..

I am using listview control and in that checkboxList. if i select any checkbox and goes to 2nd page and again i come back to 1st page then it doesnt remain selected checkbox true because i am binding new data bur how to retain old values...? plz help..

推荐答案

当您将页面从一个页面重定向到另一个页面时。当您再次返回此页面时,您的控制值将不会保留在上一页中。



要做到这一点,你必须将所选复选框的值存储在内存中,如'Session'



当你再次回到这个页面时,检查这个会话是否有价值。如果它具有值,则可以获取复选框的值并进行检查。
When you redirect your page from one to another. your control value will not be preserved for the previous page when you come back again here.

To do this you must have to store value of the selected checkboxes in in-memory like 'Session'

and when you come back again on this page check that whether this session has value or not. and if it has values than you can get values of the checkbox and make it checked.


这篇关于Listview中的checkboxList,在分页后保持选中状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆