Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, How to Add an Empty List Box and move the items from one listbox to another listbox, and save the moved data into database in asp.net MVC using EF Code first,
In my Project I have create a list box which display the data from database code is like this
In Controller:
publicActionResult Create()
        {
IEnumerable<SelectListItem> items = db.IIDBS
                .Select(c =>newSelectListItem
                {
                    Value=c.InstituteName,
                    Text=c.InstituteName
                });
ViewBag.IIDBS = items;
return View();
        }

In View:
XML
<fieldset>
         List of Financial Institute
<%:Html.ListBox("InstituteName",(IEnumerable<SelectListItem>) ViewBag.IIDBS,"Select Financial Institute Name") %>
</fieldset>

Here I want another empty Listbox and four button which move InstituteNameof first listbox to another listboxand save those data into database.
Can anyone tell me how to do this…….
Posted
Updated 23-Apr-14 3:55am
v2
Comments
Er Daljeet Singh 23-Apr-14 6:49am    
for this to implementation jquery is best suited.
Member 10714619 24-Apr-14 1:15am    
ok but can u tell me how to do it...

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