views:

39

answers:

3

I have successfully added controls to pop up, like many check boxes ... now on check box checked event I want to show another check boxes on same popup. how can I do that plz can any one help me?

+1  A: 

Make sure autopostback is true and wrap them in an updatepanel inside of the modal. Now you will be able to show/hide whatever you want on postback without the modal closing.

Mike
yes its working..thanks alott..! thnks a lott..... But now when i check that chekbox(upon this check i want other check boxes) the popup gets disappearred and i have to click again on my main page button to get popup again ..and then it shows what i want. now....I want it should remain opened when i check that check box and controls should display at same time rather than dissapearring and then displaying..
Yanka
A: 

Do you want to just display check boxes(that's hidden) on checked event of other checkbox? You can attach javascript function to onClick event of check box and you can set visibility of other check boxes.

If you want to handle that in server side, you need to set autopostback to true and specify OnCheckedChanged event.

<asp:CheckBox AutoPostBack="true" runat="server" ID="chk1" OnCheckedChanged="chk1_OnCheckedChanged" />

protected void chk1_OnCheckedChanged(object sender, EventArgs e)
{ 

}

And put the modal popup control inside the update panel.

<ajaxtoolkit:modalpopupextender runat="server" ID="mpe"
    BehaviorID="mpe_ID" PopupControlID="pnlModalPopup"  
    TargetControlID="btnSomething" CancelControlID="lnkUploadSongListOverlayClose"
    DropShadow="false" />

<asp:Panel runat="server" ID="pnlModalPopup" CssClass="modal">
<asp:UpdatePanel runat="server" ID="updatePanel">
<ContentTemplate>

   <!-- modal popup control -->

</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
shailesh
thnks a lott.....But now when i check that chekbox(upon this check i want other check boxes) the popup gets disappearred and i have to click again on my main page button to get popup again ..and then it shows what i want. now....I want it should remain opened when i check that check box and controls should display at same time rather than dissapearring and then displaying..
Yanka
You need to put the modal popup control inside the update panel. I have updated my code above.
shailesh
A: 

Here are the steps:

1- Set autopost back for the checkbox to true 2- Double click on the checkbox and on the checkbox1_OnCheckedChanged

    if(checkbox1.Checked==true){Modalpopupextender.show();}
Baharanji