TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rifat mojumder
1.6k
190
2.4k
List Box Value Save
Feb 28 2017 2:06 AM
my first 1st list box data move 2nd listbox but how can save 2nd list box data in my data base.Below My Code..
<div class="col-sm-12 col-lg-12">
<div class="col-md-4">
@Html.ListBoxFor(x => x.CommonCodeID, Model.CommoncodeItemsnull, new { @class = "BranchName", @style = "width:200px;height:100px;" })
</div>
<div class="col-sm-8 col-lg-8">
<input type="button" id="left" value="<" />
<input type="button" id="right" value=">" />
<input type="button" id="leftall" value="<<" />
<input type="button" id="rightall" value=">>" />
</div>
<div class="col-md-10">
@Html.ListBoxFor(x =>x.CommonCodeID, Model.CommoncodeItems, new { @class = "secounlist", @style = "width:200px;height:100px;" })
</div>
</div>
<script>
(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));
</script>
----------------------
model :
public int[] CommonCodeID { get; set; }
Reply
Answers (
3
)
how to use optgroup in dropdownlist in asp.net
List Box Value Save