Irwsoft NETCore Asp

DropDownList
Brief Information
DescriptionA selection tag-helper with a drop-down list.
The ComboBox mode allows user to entry custom data.
FeaturesBind one or more properties at once.
The ComboBox have DataFormat with data masking.
DropDownList tag-helper
DropDownList tag-helper


The DropDownList tag-helper is selection tag-helper with a drop-down list. The DropDownList displays items from data source. There are two DropDownList mode they are DropDownList and ComboBox. The DropDownList mode only allows user to select an item in a list, meanwhile The ComboBox mode also allows user to entry custom data.


DropDownList mode

DropDownList mode

ComboBox mode

ComboBox mode


Example : Input Gender data of Person table with DropDownList


C# code for Person table

// 1) Sample code for Person table
public class Person
{
     // 2) The columns of Person table.
     public int ID { get; set;}
     public string FirstName { get; set;}
     public string LastName { get; set;}
     public GenderType Gender { get; set;}  // 3) Input Gender property of Person.
     public DateTime DateOfBirth { get; set;}
     public int Age { get; set;}
     public string Address { get; set;}
     public string City { get; set;}
     public string Country { get; set;}
     public string IdentityCardNo { get; set;}
     public string BioData { get; set;}
     public string PictureUrl { get; set;}
}

// 4) GenderType enum values
public enum GenderType
{
     Male, Female
}

ASPX code for DropDownList

// 1) Defines the DropDownList tag-helper
<DropDownList ID="DDL1" SkinStyle="SimpleGrey">
     // 2) Defines a propertyto bind inside DataPropertyNames tag
     <DataPropertyName Name="Gender" DataType="List" Type="SamplesNET2.Data.GenderType" />
     <ListItem Text="Male" Value="Male" />
     <ListItem Text="Female" Value="Female" />
</DropDownList>


Related Topics :


Irwsoft Data Ultimate Edition 4.0 supports data-schema extension (entity framework, linq to sql, simple class, and etc).