DropDownListFor
View helper sample code
1 | @Html.DropDownListFor(model => model.OperatorValue, (List<SelectListItem>)ViewData["OperatorValue_SelectList"], new { @class = "form-control" }) |
Controller sample code, this can be in ‘Lookups.cs’ class
1 | public static List<SelectListItem> OperatorSelectList() |
DisplayNameFor
Display from property that is a list of another class
Example:
1 | public class AddViewModel |
To display the history data
1 | <table class="table"> |