Try below code:
@Html.DropDownListFor(model => model.User.Client.ClientId,
new SelectList(Model.Clients,"ClientId","Name", Model.User.Client.ClientId),
new { @class = "form-control" })
Note: you can not bind Client
class for the DropDownList, you need to use property like ClientId
.
It's better to add another property for the selected client. like below:
public class yourModel
{
public int selectedClientId {get;set;}
//
}
@Html.DropDownListFor(model => model.selectedClientId,
new SelectList(Model.Clients,"ClientId","Name", Model.User.Client.ClientId),
new { @class = "form-control" })