This question is locked. New answers and comments are not allowed.
I have a dropdown list of Roles, (see below), and I would like to default the selected value(s) to be based on a value from a model passed in. How would I set the selected value (initially) based on the model.roles field that has the data stored in a comma delimited result ? The value of model.roles would be something like "admin,user,siteAdministrator" and I would like all 3 of this values select in the list below....
.Name("packageName")
.BindTo((SelectList)ViewBag.ddlpackages)
.HtmlAttributes(new { @Style = "width:250px" }))
@model Portal.DAL.Manage.Entities.LAYOUTS
.Name("packageName")
.BindTo((SelectList)ViewBag.ddlpackages)
.HtmlAttributes(new { @Style = "width:250px" }))