I can't sleep so I will do some of this for you. First make your dropdownlist add a button and add a call to a javascript fuction.
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<br /><br />
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="javascript:return wait();" onclick="Button1_Click" />
Here is a quit javascript comfirm.
<script type="text/javascript">
function wait()
{
if (confirm("Are you sure you want to delete this from the dropdownlist?") == true)
return true;
else
return false;
}
</script>
Now lets make a generic list in the page load, you would want to load your droplistlist from your database.
using System.Collections.Generic;
public partial class GenericList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
List<string> myList = new List<string>();
myList.Add("Item One");
myList.Add("Item Two");
myList.Add("Item Three");
myList.Add("Item Four");
DropDownList1.DataSource = myList;
DropDownList1.DataBind();
}
}
Now lets do the button click event.
protected void Button1_Click(object sender, EventArgs e)
{
DropDownList1.Items.Remove(DropDownList1.SelectedItem);
}
There you go I don't think I forgot anything but like I said above you would fill your genericlist from your database then bind it to your dropdownlist. The idea is the same...