Asp Modal Popup:How to prevent from closing

Discussion in '.NET' started by arvee2003, Feb 1, 2011.

  1. arvee2003

    arvee2003

    Joined:
    Feb 1, 2011
    Messages:
    1
    Likes Received:
    0
    In an aspx page I have an user control which in turn opens a modal popup which is
    another user control.

    In the usercontrol in modalPopup I have a check box with a checkedChanged event.

    When the checkbox is checked, I check/uncheck all items in a check box list in the user control.

    However when the event is completed it closes the modal popup. How do I avoid the modal
    popup from being closed. I do not have a modalpopupextender property in user control

    I tried using return statement, it does not work.

    ANy input is appreciated.

    Thanks
    Suresh

    Code (Text):

    protected void CheckBoxSelectAll_CheckedChanged(object sender, EventArgs e)
        {
            Int32 indexCount = 0, totalCount = 0;
            totalCount = Convert.ToInt32(cblLevelList.Items.Count);
            Control ctrl = (Control)FindControl("ModalPopupExtenderLevel");
            if (CheckBoxSelectAll.Checked)
            {
                for (indexCount = 0; indexCount < totalCount; indexCount++)
                {
                    cblLevelList.Items[indexCount].Selected = true;
                }
            }
            else
            {
                for (indexCount = 0; indexCount < totalCount; indexCount++)
                {
                    cblLevelList.Items[indexCount].Selected = false;

                }
            }
             
            return;
           
        }

    <asp:Panel ID="PanelLevelHeader" runat="server" style="height:250px;position:absolute;width:320px;text-align:center;" HorizontalAlign="Center">
            <asp:CheckBox  id="CheckBoxSelectAll" runat="server" Text="Select All"
                     ToolTip="Click to select all Level"
                   Style="text-align:center;font-family:Arial,Helvetica;font-style:normal;font-size:9pt;"
                  OnCheckChanged="CheckBoxSelectAll_CheckedChanged" CausesValidation="True" AutoPostBack="True">
             </asp:CheckBox>
             <hr />
             </asp:Panel>
              <br />
             <asp:Panel ID="PanelLevelDetail" runat="server" style="height:200px;width:320px;margin-top:10px;background-color:#fff; "       ScrollBars="Auto">    
                 
                <asp:CheckBoxList ID="cblLevelList" runat="server" style="height:40px;text-align:left;font-family:Arial,Verdana;font-size:9pt;"  
                        DataSourceID="ObjectDataSourceLevel" DataTextField="rv_meaning" DataValueField="rv_low_value" Height="40px" >      
                       </asp:CheckBoxList>
                       <asp:ObjectDataSource ID="ObjectDataSourceLevel" runat="server"  
                       TypeName="locator_reference_codes" SelectMethod="GetMultiTrainingLevels" >    
                </asp:ObjectDataSource>
             </asp:Panel>
     
    arvee2003, Feb 1, 2011
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.