Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to create list box in View where i will enter value in list box from two text box...eg.name and emailid text box and that two value i want to add in list box on click of add button...is there any similar example any one know..i have done same thing in C#..but how to do in MVC3 little bit confuse...anyone knows
Posted

1 solution

Did you try doing this ?

@Html.ListBoxFor(m => m.Foos, new MultiSelectList(Model.Foos, "ID", "Name"), new {Multiple = "multiple"}) 
 
Share this answer
 
Comments
vishal_h 21-Oct-11 1:37am    
thanks sir but i want to add that two value from client side and onclick of submit button i want send total list to controller..
AswinKrishnan 21-Oct-11 1:51am    
Hi Vishal,

Modify your Model to accommodate the ListBox, so you can send it on post.

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