Click here to Skip to main content
15,892,797 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a Table with columns: id, name and value in it.
I have a DropDownList in Index.cshtml and it works:
HTML
@Html.DropDownList("ddl0", new SelectList(Model, "value", "name"))

I want to convert this to a "DropDownListFor".
How do I do this and how do I see the result or manipulate it in the "Controller"?
Posted
Updated 12-Feb-15 5:24am
v2
Comments
Afzaal Ahmad Zeeshan 12-Feb-15 13:13pm    
What is the problem that you're facing?
teledexterus 12-Feb-15 15:55pm    
@Html.DropDownListFor(m => m, new SelectList(Model.ddltable, "value", "name"), new { valueNow=??currentvalue?? })
Afzaal Ahmad Zeeshan 13-Feb-15 5:55am    
That is the code, not the problem. Is it?
Member 12778078 20-Oct-16 13:33pm    
How to make @Html.DropDownListFor editable?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900