I have successfully add开发者_Go百科ed 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?
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.
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>
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();}
精彩评论