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
jijil kb
NA
99
18.8k
Client side data lose when posback occurs in asp.net c#
Jan 6 2011 7:40 AM
have 10 list boxes in my for all 10 list boxes same function is using for some buttons i want to add listbox data to grid can you help me my java script code shown below
<script language="javascript" type="text/javascript" >
function MoveItem(ctrlSource, ctrlTarget) {
var Source = document.getElementById(ctrlSource);
var Target = document.getElementById(ctrlTarget);
if ((Source != null) && (Target != null)) {
while ( Source.options.selectedIndex >= 0 ) {
var newOption = new Option(); // Create a new instance of ListItem
newOption.text = Source.options[Source.options.selectedIndex].text;
newOption.value = Source.options[Source.options.selectedIndex].value;
Target.options[Target.length] = newOption; //Append the item in Target
Source.remove(Source.options.selectedIndex); //Remove the item from Source
}
}i tried a javascript above code to move items between listbox using html input button problem when i trying to save listbox.items.count giving 0 can anyone tell me why this happening and also when post back occurs listbox items lost.
Reply
Answers (
3
)
dataset
membership in asp.net