c# - Default value for Html dropdown list -



c# - Default value for Html dropdown list -

i using mvc4 , c#. have dropdownlist set using viewbag.

@html.dropdownlist("category_parent", new selectlist(viewbag.category, "id", "name"), new { @class = "form-control" })

by default selects first value want select null value (a default value). how can this?

c# asp.net-mvc-4

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -