Add default value for dropdownlist


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



Copy this code and paste it in your HTML
  1. ddMyDropdown.Items.Insert(0, "Select a Title");
  2.  
  3. //or, to set value explicitly to null:
  4. ddAffiliation.Items.Insert(0, new ListItem("Select Affiliation", null));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.