Hi micah,
Refer below code.
HTML
<div class="container">
<asp:DropDownList ID="ddlmethode" runat="server"
CssClass="form-control pro-edt-select form-control-primary" Width="100%"
AutoPostBack="true" OnSelectedIndexChanged="DropDownList_Changed">
<asp:ListItem Text="--Select Payment Method--" Value="C" />
<asp:ListItem Text="Cash" Value="Ca" />
<asp:ListItem Text="Cheque" Value="CH" />
<asp:ListItem Text="Transfer" Value="TR" />
</asp:DropDownList>
<asp:Panel ID="pnlTextBox" runat="server" Visible="false">
<asp:TextBox ID="txtbank" runat="server" CssClass="form-control" placeholder="Bank Name"></asp:TextBox>
</asp:Panel>
</div>
Code
C#
protected void DropDownList_Changed(object sender, EventArgs e)
{
pnlTextBox.Visible = false;
if (ddlmethode.SelectedItem.Value == "CH" || ddlmethode.SelectedItem.Value == "TR")
{
pnlTextBox.Visible = true;
}
}
VB.Net
Protected Sub DropDownList_Changed(ByVal sender As Object, ByVal e As EventArgs)
pnlTextBox.Visible = False
If ddlmethode.SelectedItem.Value = "CH" OrElse ddlmethode.SelectedItem.Value = "TR" Then
pnlTextBox.Visible = True
End If
End Sub
Screenshot