本文介绍了当mannul回复时,无法获取asp.net检查列表框项目的选中状态。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 function CountrySelect(uniqueID){ var dialog_buttons = {}; dialog_buttons [' 保存'] = 功能(){__ doPostBack(' chkcountries',' '); } $( document )。ready( function (){ $( function (){ var dlg = $( #dialog)。dialog({ maxWidth: 400 , maxHeight: 500 ,宽度: 400 , height: 500 , autoOpen: false , modal: true , buttons:dialog_buttons, title: 国家/地区选择对话框, close:CloseFunction , show:{ effect: Clip,持续时间: 1000 },隐藏:{效果: 淡入淡出,持续时间: 1000 } }); dlg.dialog(' open'); function CloseFunction(){ __doPostBack(' logout',' '); }; }); }); } 和带有id对话框的div的标记是 < div id = 对话框 style = 显示:无 > < p > 选择国家< / p > < p > < asp:CheckBoxList ID = chkcountries runat = 服务器 > < / asp:CheckBoxList > < / p > < / div > 和cs文件代码是 foreach (ListItem val in chkcountries.Items) { if (val .Selected == true ) { } } 问题在回发时说它没有检查项目。为什么 val.selected = false 总是解决方案 ( function (){ var dlg = function CountrySelect(uniqueID) { var dialog_buttons = {}; dialog_buttons['Save'] = function () { __doPostBack('chkcountries', ''); } $(document).ready(function () { $(function () { var dlg = $("#dialog").dialog({ maxWidth: 400, maxHeight: 500, width: 400, height: 500, autoOpen: false, modal: true, buttons:dialog_buttons, title:"Country Selection dialog", close: CloseFunction , show: { effect: "Clip", duration: 1000 }, hide: { effect: "fade", duration: 1000 } }); dlg.dialog('open'); function CloseFunction() { __doPostBack('logout', ''); }; }); }); }and markup for div with id dialog is<div id="dialog" style="display:none"> <p>Select Countries</p> <p> <asp:CheckBoxList ID="chkcountries" runat="server"> </asp:CheckBoxList> </p> </div>and in cs file code is foreach (ListItem val in chkcountries.Items) { if (val.Selected == true) { } }problem is on postback it says no item is checked. why val.selected=false always 解决方案 这篇关于当mannul回复时,无法获取asp.net检查列表框项目的选中状态。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-31 14:24