6
Answers

Working with Lists

Photo of Christian Nwamba

Christian Nwamba

11y
1.4k
1
  public static List<SelectListItem> Title()
        {
            List<SelectListItem> items = new List<SelectListItem>();
            items.Add(new SelectListItem { Text = "MR", Value = "" });
            items.Add(new SelectListItem { Text = "MRS", Value = "" });

            return items;
        }

Please in the above code. Is there any possible way to automatically populate the value with the the vallue of the Text. Thanks

Answers (6)