public class details { [DisplayName("Age")] public int age { get; set; } }
@Html.DropDownListFor{"Model.Id",new SelectListItem{@ViewBag,DataFieldId,DataFieldValue},"Show Caption Value",new{id="abc"}
This is sample code from which you get clear idea
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)