ASP.net MVC DropDownListFor or DropDownList with Strongly Typed ViewModel?

%= Html. DropDownListFor(m => m. Property, new SelectList(your_collection, "key", "code", Model.

Property), "") % key" and "code" are properties of your Collection objects and the empty "" at the end is an optional label.

M. Property, new SelectList(your_collection, "key", "code", Model. Property), "") %> "key" and "code" are properties of your Collection objects and the empty "" at the end is an optional label.

Thanks for answering David. How does m. Property relate to Model.

Property? – AdamOB Feb 21 at 2:05 As your View is strongly-typed then by doing m => m. Property will only allow you to create the drop down list for a speicifc property of your strongly-typed view.

The Model. Property is just the current property value for your object (it could be anything). – David Liddle Feb 21 at 2:05.

DropDownListFor(m => m. New SelectList(your_collection, "key", "code", Model. "key" and "code" are properties of your Collection objects and the empty "" at the end is an optional label.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions