rifat mojumder

rifat mojumder

  • 1.5k
  • 193
  • 2.4k

List Box ALl Item Pass Controller

Mar 9 2017 1:22 AM
This Is My View Model :
public class myViewModel 
{ public List<Role> AvailableProducts { get; set; }
public List<Role> RequestedProducts { get; set; }
 public int[] AvailableSelected { get; set; }
public int[] RequestedSelected { get; set; }
public string SavedRequested { get; set; } }


This Is My View Code :
  @Html.ListBoxFor(Model => Model.AvailableSelected, new MultiSelectList(Model.AvailableProducts, "Id", "Name", Model.AvailableSelected), new { size = "6" ,id= "lstAll" }) td> 
<input id="btnAddAll" type="button" value=">> " />
<input id="btnAdd" type="button" value="> " />
<
input id="btnRemove" type="button" value="<" />
<input id="btnRemoveAll" type="button" value="<< " /> td>
@Html.ListBoxFor(Model => Model.RequestedSelected, new MultiSelectList(Model.RequestedProducts, "Id", "Name", Model.RequestedSelected), new { size = "6", id = "lstselected" }) td> tr>


-----Now I want to receive all items of second list in controller.--------------
This Is My Controller
[HttpPost] public ActionResult Create(MyViewModel ObjMyViewModel)
 
{
}