Search code examples
asp.net-mvcrazorgeneric-collections

Define List<T> in razor page


Why when I try define List object there are inserts tag names instead 'T'?

enter image description here


Solution

  • You should enclose all code after @ in parentheses:

    <td>@(Html.DropDownList("yyy", new SelectList(new List<string>{"",""})))</td>