Answers for "pass viewbag selectlistitem to razor"

C#
0

pass viewbag selectlistitem to razor

//viewbag with selectlist
@Html.DropDownList("AccountId", (IEnumerable<SelectListItem>)ViewBag.Accounts, null, new { @class ="form-control" })
  
// viewbag contains list<selectlistitem>  
@Html.DropDownList("mySelectList", ViewBag.SomethingSelect , "Select Something", new {@class = "form-control text-center w-75"} )
Posted by: Guest on March-09-2022

C# Answers by Framework

Browse Popular Code Answers by Language