如果使用updatepanel,则在页面刷新后取消选中复选框 [英] checkbox unchecked after page refresh if updatepanel used

查看:74
本文介绍了如果使用updatepanel,则在页面刷新后取消选中复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用asp:update panel a

I used asp:update panel a





<asp:UpdatePanel ID="GetUpdDet"  runat="server" UpdateMode="Conditional">
  <ContentTemplate>










<asp:CheckBoxList ID="chkCountries" runat="server" AutoPostBack="true"  OnSelectedIndexChanged="Country_Selected">
                                <asp:ListItem Text="rating 5" Value="5"><span class="Fivestar_ft"></span></asp:ListItem>
                                <asp:ListItem Text="rating 4" Value="4"><span class="Fourstar_ft"></span></asp:ListItem>
                                <asp:ListItem Text="rating 3" Value="3"><span class="Threestar_ft"></span></asp:ListItem>
                                <asp:ListItem Text="rating 2" Value="2"><span class="Twostar_ft"></span></asp:ListItem>
                            </asp:CheckBoxList>







< asp:listview ID =ProductListList运行at =server>










<asp:listview ID="ProductListList" runat="server" >



</ContentTemplate>
         </asp:UpdatePanel>






上面的
如果我点击复选框,我调用OnSelectedIndexChanged =Country_Selected函数,并过滤listview和listview.datasource和databind

,和updatepanelid.update();





在page_load中,我使用






in above if i click checkbox , i call OnSelectedIndexChanged="Country_Selected" function, and filter listview and listview.datasource and databind
, and updatepanelid.update();


in page_load , i use

if (!ispostback) listview.datasource and databind







但是,当我点击复选框时,页面不刷新,我在listview中看到过滤后的值,然后当我手动刷新页面时,复选框未选中,并显示列表视图是原始的没有过滤器..



请参阅建议,如何选中保持复选框,以及使用updatepanel,




but , when i click checkbox , page doesnot refresh and i see filtered value in listview , then when i refresh page manually, checkbox is unchecked , and listview shown is original without filters..

pls advice, what to do to keep checkbox as checked ,and gridview filtered , when page refresh with updatepanel ,

推荐答案

hi
是的,如果你使用更新面板,选中的标记将被删除,即你在页面加载事件时得到的结果,所以删除更新面板和尝试使用没有页面refres的客户端编码你需要获得复选框检查ID并过滤并在listview中显示
hi yes if u use update panel,checked mark will be erased ,i.e what u get when page load event it goes like,so remove update panel and try to use client side coding without page refresh u need to get check box checked id and filter and show in listview


这篇关于如果使用updatepanel,则在页面刷新后取消选中复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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