Can someone suject how do I insert new row for dropdownlist in MVC3? I am reterive some set of values from database using Entity Framework and displaying in my view page using dropdownlistfor control, I want to include one more row to my retrieving result.
Can anyone advise me on that?
Example - in webapplication to add a new row we do " ddl1.Items.Insert(0, new ListItem("ALL", "-1")); "
Dropdownlistfor gives the option for adding "option label" but not the value for that option label though
kamaleswaran
Member
73 Points
87 Posts
Inserting new row in dropdownlistfor control
May 01, 2012 08:06 AM|LINK
Hi
Can someone suject how do I insert new row for dropdownlist in MVC3? I am reterive some set of values from database using Entity Framework and displaying in my view page using dropdownlistfor control, I want to include one more row to my retrieving result. Can anyone advise me on that?
Example - in webapplication to add a new row we do " ddl1.Items.Insert(0, new ListItem("ALL", "-1")); "
Dropdownlistfor gives the option for adding "option label" but not the value for that option label though
Kam
DarrellNorto...
All-Star
86703 Points
9638 Posts
Moderator
MVP
Re: Inserting new row in dropdownlistfor control
May 01, 2012 09:24 AM|LINK
See this thread:
http://forums.asp.net/post/3943424.aspx
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.