Wednesday, July 27, 2022

How to reset drop down list in ASP.NET C# or to select the select value in drop down

 protected void DDL_KIA_OnSelectedIndexChanged(object sender, EventArgs e)

    {

        //New Code Add on 15072020

        DDL_FinYear.SelectedIndex = -1;

        DDL_Course.SelectedIndex = -1;

        DDL_Batch.SelectedIndex = -1;

        DDL_Status.SelectedIndex = -1;


        //BindYear();

    }



<asp:DropDownList ID="DDL_Status" Width="150px" runat="server" AutoPostBack="true" CssClass="form-control input-sm" OnSelectedIndexChanged="DDL_Status_OnSelectedIndexChanged">

                        <asp:ListItem Value="-1">-- Select --</asp:ListItem>

                            <asp:ListItem Value="5">New Request</asp:ListItem>

                            <asp:listitem Value="0">Requested to KIA</asp:listitem>

                            <asp:listitem Value="2">Approved</asp:listitem>

                            <asp:listitem Value="3">Rejected</asp:listitem>

                        </asp:DropDownList>

No comments:

Post a Comment