Dropdown with databind example and default value

/ Published in: C#
Save to your folder(s)

Copy this code and paste it in your HTML
  1. cboLocation.DataSource = GetLocations()
  2. cboLocation.DataTextField = "StateCityLabel"
  3. cboLocation.DataValueField = "LocationCode"
  4. cboLocation.DataBind()
  5. cboLocation.Items.Insert(0, New ListItem("Select Location...", ""))

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.