Tuesday, December 27, 2022

How to insert and remove all elements from dropdown list - ASP.NET

 For Insert


ddlDiscipline.Items.Insert(0, new ListItem("--Select--", "--Select--"));


For Remove:-


ddlDiscipline.Items.Clear();

 ddlDiscipline.Items.Insert(0, new ListItem("--Select--", "--Select--"));


reference:- https://meeraacademy.com/how-to-use-clear-remove-and-removeat-in-dropdownlist-in-asp-net/

No comments:

Post a Comment