<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:DropDownList ID="ddl_mode" runat="server" AutoPostBack="true" onselectedindexchanged="ddl_mode_SelectedIndexChanged"> <asp:ListItem> By Cash</asp:ListItem> <asp:ListItem> By Cheque</asp:ListItem> <asp:ListItem> By Card</asp:ListItem> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel> <asp:Panel ID="Pnl_pay_Cheque" runat="server"> <table> <tr align="center"> <td> <strong>Cheque No. :</strong></td> <td> <asp:TextBox ID="txt_Chequeno" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txt_Chequeno" ErrorMessage="*Required" SetFocusOnError="true"></asp:RequiredFieldValidator> </td> </tr> <tr align="center"> <td> <strong>Cheque Date :</strong></td> <td> <asp:TextBox ID="txt_Chequedate" runat="server" onclick="showCalendarControl(this)"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txt_Chequedate" ErrorMessage="*Required" SetFocusOnError="true"></asp:RequiredFieldValidator> </td> </tr> <tr align="center"> <td> <strong>Bank Name :</strong></td> <td> <asp:TextBox ID="txt_Chequebank" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txt_Chequebank" ErrorMessage="*Required" SetFocusOnError="true"></asp:RequiredFieldValidator> </td> </tr> </table> </asp:Panel> <asp:Panel ID="Pnl_pay_Card" runat="server"> <table> <tr align="center"> <td> <strong>Card No. :</strong></td> <td> <asp:TextBox ID="txt_cardno" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txt_cardno" ErrorMessage="*Required" SetFocusOnError="true"></asp:RequiredFieldValidator> </td> </tr> <tr align="center"> <td> <strong>Bank Name :</strong></td> <td> <asp:TextBox ID="txt_cardbank" runat="server"></asp:TextBox> </td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txt_cardbank" ErrorMessage="*Required" SetFocusOnError="true"></asp:RequiredFieldValidator> </td> </tr> </table> </asp:Panel>
protected void ddl_mode_SelectedIndexChanged(object sender, EventArgs e) { if (ddl_mode.SelectedIndex == 0) { Pnl_pay_Cheque.Visible = false; Pnl_pay_Card.Visible = false; txt_enteramt.Text = "0"; } else if (ddl_mode.SelectedIndex == 1) { Pnl_pay_Cheque.Visible = true; Pnl_pay_Card.Visible = false; txt_enteramt.Text = "0"; } else if (ddl_mode.SelectedIndex == 2) { Pnl_pay_Card.Visible = true; Pnl_pay_Cheque.Visible = false; txt_enteramt.Text = "0"; } txt_enteramt.Text = ""; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)