I have two list boxes in my view with four arrows to exchange the items between them. I am using 4 buttons with type="submit" and handling it in the controller. Is there any way that i can do it with out postback?
<table style="width:90%; text-align:center">
<thead>
<tr>
<th>Unassigned State:</th><th>
</th><th>Assigned State:</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top">
@Html.ListBoxFor(model => model.UnAssignedSelected,
new MultiSelectList(Model.UnAssignedStates, "Id",
"Name", Model.UnAssignedSelected),
new { size = "6" })
</td>
<td valign="top">
<button style=" width:50px" name="button" value="oneRightArrow" type="submit"> > </button><br />
<button style=" width:50px" name="button" value="twoRightArrow" type="submit"> >> </button><br />
<button style=" width:50px" name="button" value="oneLeftArrow" type="submit"> < </button><br />
<button style=" width:50px" name="button" value="twoLeftArrow" type="submit"> << </button>
</td>
<td valign="top">
@Html.ListBoxFor(model => model.AssignedSelected,
new MultiSelectList(Model.AssignedStates, "Id",
开发者_JS百科 "Name", Model.AssignedSelected))
</td>
</tr>
</tbody>
You can use jQuery for that. Example: http://www.meadmiracle.com/dlb/DLBDocumentation.aspx
精彩评论