Click here to Skip to main content
15,891,873 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
JavaScript
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
ASP.NET
<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
C#
foreach (ListItem val in chkcountries.Items)
             {
                 if (val.Selected == true)
                 {

                 }
             }


problem is on postback it says no item is checked. why
C#
val.selected=false
always
Posted
Updated 15-Apr-15 22:18pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900