Add New Class and rename as CommonEnum.
Note:- Set location in App_Code.So it can access any in a project.
Add method
nameSpace Enum
{
Public ClassCommonEnum()
{
}
Public enum Operation
{Insert =1,
Update=2,
Delete=3,
Select=4
}
}
Add New Web Page
Add Asp .Net DropDownList control in .aspx page
<asp:DropDownList Id="ddlOperation" runat= "Server"/>
Add name Space on web Page.cs
Array arrop=Enum.GetValues(typeof(CommonEmum.Operation));
foreach(CommonEnum.Operation opt in arrop)
{
ddlOperation.Items.Add(new ListItem(opt.ToString(),((Int)opt).Tostring()));
}
No comments:
Post a Comment