How to Implement Multiselect Listbox i.e selectbox with attribute mutiple = true. You need to Do a Save and Loading of data in pre-selected manner for Mutiselect listbox in asp.net mvc 4 razor. ? with full example as well as demo..
Thank you in advance.....
Loading


Lucky Laxman92 reputationPosted Feb 10, 2015, 6:25 PM EST
Will please give me the example what you what i can understand clearly and i can give you response
Thank you.
Shailesh Prajapati5 reputationPosted Feb 10, 2015, 8:40 PM EST
Lucky Laxman92 reputationPosted Feb 7, 2015, 1:12 AM EST
I am giving this example Loading Drop down Values Statically you can modify too Dynamically
Now Please go like this..,
In Your Controller
// Index Code
Public ViewResult Index()
{
// This can be get the list of Values .
LoadDropDown();
return View();
}
// This Method Can Load values in List
Public Void LoadDropDown()
{
var DorpDlist = new SelectList(new[]
{
new {ID="1",Name="Adilabad"},
new{ID="2",Name="Hyderbad"},
new{ID="3",Name="Warangal"}, },
"ID", "Name", 1);
//This ViewBag Store the data Dynamic . You can use linke.
ViewBag.Cities = DorpDlist ;
}
// Code in View
@Html.DropDownList("Cities ","Select locations")
I hope it will help you. if help full are not help full please make a comment , i can improve to more given answers .
Thanks,
Joginder BangerRank #360 · 7K reputationPosted Feb 7, 2015, 1:26 AM EST
What is this code make a multiple select data??????????