How to make textbox true and false based on DropDownList_Changed more than one values
<asp:DropDownList ID="txt_typ_of_prcrmnt_in_cs_of_deptt_prchs" runat="server" CssClass="auto-style69" ValidationGroup="First"
AutoPostBack="true" OnSelectedIndexChanged="DropDownList_Changed" Height="25px" Width="299px">
<asp:ListItem Text="--Select Procurement type--" Value="C" />
<asp:ListItem Text="Store" Value="Store" />
<asp:ListItem Text="Gem" Value="Gem" />
<asp:ListItem Text="Imprest site" Value="Imprest site" />
<asp:ListItem Text="Cash" Value="Cash" />
<asp:ListItem Text="From_site" Value="From_site" />
</asp:DropDownList>
protected void DropDownList_Changed(object sender, EventArgs e)
{
DropDownList dropDownList = sender as DropDownList;
if (txt_typ_of_prcrmnt_in_cs_of_deptt_prchs.SelectedItem.Value == "Store")
{
txt_dprtmntl_rg_s_no_page_n.Visible = false;
txt_vndr_nm.Visible = false;
txt_Vndr_mob_no.Visible = false;
txt_amt.Visible = false;
txt_purchs_by.Visible = false;
txt_dt_of_prchs.Visible = false;
// txt_rmk_one.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
Label11.Visible = false;
Label12.Visible = false;
RequiredFieldValidator5.Visible = false;
RequiredFieldValidator6.Visible = false;
RequiredFieldValidator7.Visible = false;
RequiredFieldValidator8.Visible = false;
RequiredFieldValidator9.Visible = false;
RequiredFieldValidator10.Visible = false;
RequiredFieldValidator11.Visible = false;
}
else
{
txt_dprtmntl_rg_s_no_page_n.Visible = true;
txt_vndr_nm.Visible = true;
txt_Vndr_mob_no.Visible = true;
txt_amt.Visible = true;
txt_purchs_by.Visible = true;
txt_dt_of_prchs.Visible = true;
// txt_rmk_one.Visible = true;
Label7.Visible = true;
Label8.Visible = true;
Label9.Visible = true;
Label10.Visible = true;
Label11.Visible = true;
Label12.Visible = true;
RequiredFieldValidator5.Visible = true;
RequiredFieldValidator6.Visible = true;
RequiredFieldValidator7.Visible = true;
RequiredFieldValidator8.Visible = true;
RequiredFieldValidator9.Visible = true;
RequiredFieldValidator10.Visible = true;
RequiredFieldValidator11.Visible = true;
}
if (txt_typ_of_prcrmnt_in_cs_of_deptt_prchs.SelectedItem.Value == "From_site")
{
txt_dprtmntl_rg_s_no_page_n.Visible = false;
txt_vndr_nm.Visible = false;
txt_Vndr_mob_no.Visible = false;
txt_amt.Visible = false;
txt_purchs_by.Visible = false;
txt_dt_of_prchs.Visible = false;
// txt_rmk_one.Visible = false;
Label7.Visible = false;
Label8.Visible = false;
Label9.Visible = false;
Label10.Visible = false;
Label11.Visible = false;
Label12.Visible = false;
RequiredFieldValidator5.Visible = false;
RequiredFieldValidator6.Visible = false;
RequiredFieldValidator7.Visible = false;
RequiredFieldValidator8.Visible = false;
RequiredFieldValidator9.Visible = false;
RequiredFieldValidator10.Visible = false;
RequiredFieldValidator11.Visible = false;
}
else
{
txt_dprtmntl_rg_s_no_page_n.Visible = true;
txt_vndr_nm.Visible = true;
txt_Vndr_mob_no.Visible = true;
txt_amt.Visible = true;
txt_purchs_by.Visible = true;
txt_dt_of_prchs.Visible = true;
// txt_rmk_one.Visible = true;
Label7.Visible = true;
Label8.Visible = true;
Label9.Visible = true;
Label10.Visible = true;
Label11.Visible = true;
Label12.Visible = true;
RequiredFieldValidator5.Visible = true;
RequiredFieldValidator6.Visible = true;
RequiredFieldValidator7.Visible = true;
RequiredFieldValidator8.Visible = true;
RequiredFieldValidator9.Visible = true;
RequiredFieldValidator10.Visible = true;
RequiredFieldValidator11.Visible = true;
}
}