Radiobuttonlist+AJAX Modal POPup Control
-
I am opening an panel when i click newuser linkbuttton. Panel consists of 4 diff. radiobuttons wen i select an radio button option..it should navigate to new page <asp:LinkButton ID="linkNewUser" runat="server" style="z-index: 1; left: 42px; top: 170px; position: absolute; height: 21px; width: 76px">NewUser</asp:LinkButton> <asp:Panel ID="panelSelection" runat="server" CssClass="modalPopup" style="display: none" > <asp:RadioButtonList ID="RadioButtonList1" runat="server" > <asp:ListItem Value="0">Patient</asp:ListItem> <asp:ListItem Value="1">Doctor</asp:ListItem> <asp:ListItem Value="2">Pharmacy</asp:ListItem> <asp:ListItem Value="3">Lab</asp:ListItem> </asp:RadioButtonList><br /> <p style="text-align: center;"> <asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click" /> <asp:Button ID="CancelButton" runat="server" Text="Cancel"/> </p> </asp:Panel> <ajaxToolKit:ModalPopupExtender ID="linkNewUser_ModalPopupExtender" runat="server" TargetControlID="linkNewUser" PopupControlID="panelSelection" BackgroundCssClass="modalBackground" OkControlID="OkButton" CancelControlID="CancelButton" DropShadow="true"> </ajaxToolKit:ModalPopupExtender> protected void OkButton_Click(object sender, EventArgs e) { if (RadioButtonList1.SelectedItem.Text=="Patient") { Response.Redirect("~/PatientRegDetails.aspx"); } else if (RadioButtonList1.SelectedValue=="1") { //this has to be closed } } Here OKButton_Click event is not fired.
-
I am opening an panel when i click newuser linkbuttton. Panel consists of 4 diff. radiobuttons wen i select an radio button option..it should navigate to new page <asp:LinkButton ID="linkNewUser" runat="server" style="z-index: 1; left: 42px; top: 170px; position: absolute; height: 21px; width: 76px">NewUser</asp:LinkButton> <asp:Panel ID="panelSelection" runat="server" CssClass="modalPopup" style="display: none" > <asp:RadioButtonList ID="RadioButtonList1" runat="server" > <asp:ListItem Value="0">Patient</asp:ListItem> <asp:ListItem Value="1">Doctor</asp:ListItem> <asp:ListItem Value="2">Pharmacy</asp:ListItem> <asp:ListItem Value="3">Lab</asp:ListItem> </asp:RadioButtonList><br /> <p style="text-align: center;"> <asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click" /> <asp:Button ID="CancelButton" runat="server" Text="Cancel"/> </p> </asp:Panel> <ajaxToolKit:ModalPopupExtender ID="linkNewUser_ModalPopupExtender" runat="server" TargetControlID="linkNewUser" PopupControlID="panelSelection" BackgroundCssClass="modalBackground" OkControlID="OkButton" CancelControlID="CancelButton" DropShadow="true"> </ajaxToolKit:ModalPopupExtender> protected void OkButton_Click(object sender, EventArgs e) { if (RadioButtonList1.SelectedItem.Text=="Patient") { Response.Redirect("~/PatientRegDetails.aspx"); } else if (RadioButtonList1.SelectedValue=="1") { //this has to be closed } } Here OKButton_Click event is not fired.
I think OKControlId Property of ModalPopup Control Extender and onClick of the Ok Button is in conflict. When you specify the OkControlId of ModalPopupExtender then it won't execute the button OnClick Event. So just remove the OkControlId property of ModalPopupExtender.
-
I think OKControlId Property of ModalPopup Control Extender and onClick of the Ok Button is in conflict. When you specify the OkControlId of ModalPopupExtender then it won't execute the button OnClick Event. So just remove the OkControlId property of ModalPopupExtender.