asp.net mvc - DropDownListFor appears to populate magically -
stumbled upon dropdown:
@html.dropdownlistfor(c => c.rabbitid, null, "please select bunny...", new {@class = "wibble"})
the selectlist parameter being passed null, yet still appears populate full list of bunnys.
i suspect it's because c, model, entity (the author using entity model). can't sure. can't find behaviour documented anywhere.
i'm surprised works selectlist being null. ideas?
very badly documented in msdn have found answer. if null specified, html.dropdownlist in viewdata (viewbag) entry same key contains selectlist of data.
i hope helps in future. it's quite unintuitive.
Comments
Post a Comment