SiteMap  | About    

DropDownList Control

The drop-down list can contain any number of items and allows the user to select a single item from the drop-down list.


A default ListItem can be added to a DropDownList programmatically with the following syntax after binding data to the DropDownList:




The following ASP.NET program add seven days in a week to the DropDownList in the form load event and display the selected item in the button click event.



<html xmlns="">
<head id="Head1" runat="server">
	<title>Untitled Page</title>
	<form id="form1" runat="server">
	   <asp:DropDownList ID="DropDownList1" runat="server">
	   <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
	   <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Click the following links to see full source code

C# Source Code
VB.NET Source Code
default.aspx.vb (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.