0
votes

i have added drop with some static value but its showing error

@Html.DropDownListFor(model => model.MRStype, new SelectList(new List { new { Value = "0", Text = "--Select--" },enter code here new {Value = "1", Text = "Internal Issue" }, new { Value = "2" , Text = "External Issue" } }, "value", "text" ), new { @class = "form-control", @id = "ddlSourceType" })

1

1 Answers

0
votes

Change your Code to this one (use List instead of List)

@Html.DropDownListFor(model => model.GlobalStudentId, new SelectList(new List<object> { new { Value = "0", Text = "--Select--" }, new { Value = "1", Text = "Internal Issue" }, new { Value = "2", Text = "External Issue" } }, "value", "text"), new { @class = "form-control", @id = "ddlSourceType" })