my first 1st list box data move 2nd listbox but how can save 2nd list box data in my data base.Below My Code..
@Html.ListBoxFor(x => x.CommonCodeID, Model.CommoncodeItemsnull, new { @class = "BranchName", @style = "width:200px;height:100px;" })
@Html.ListBoxFor(x =>x.CommonCodeID, Model.CommoncodeItems, new { @class = "secounlist", @style = "width:200px;height:100px;" })
(function () {
$('#right').click(function (e) {
var selectedOpts = $('.BranchName option:selected');
if (selectedOpts.length == 0) {
alert("Nothing to move.");
e.preventDefault();
}
$('.secounlist').append($(selectedOpts).clone());
$(selectedOpts).remove();
e.preventDefault();
});
$('#left').click(function (e) {
var selectedOpts = $('.secounlist option:selected');
if (selectedOpts.length == 0) {
alert("Nothing to move.");
e.preventDefault();
}
$('.BranchName').append($(selectedOpts).clone());
$(selectedOpts).remove();
e.preventDefault();
});
}(jQuery));
----------------------
model :
public int[] CommonCodeID { get; set; }
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitin SontakkePosted Feb 28, 2017, 3:39 AM