开发者

mvc3 exchange items between listboxes

开发者 https://www.devze.com 2023-03-30 16:04 出处:网络
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 wit

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号