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
    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:
    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leila
    Replies:
    0
    Views:
    421
    Leila
    Apr 26, 2005
  2. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    661
    Thomas Hansen
    Feb 15, 2007
  3. Mike Hofer

    AJAX: Closing a modal popup dialog

    Mike Hofer, Jul 31, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    811
    bruce barker
    Aug 1, 2008
  4. Urs Gubler
    Replies:
    0
    Views:
    158
    Urs Gubler
    Jul 2, 2003
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    560
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page