Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
client side data lose when posback occurs in asp.net c#
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
jijil kb
13y
1.9k
1
Reply
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="javas
cript" type="text/java
script" >
function MoveItem(ctrlSo
urce, ctrlTarget) {
var Source = document.getEle
mentById(ctrlSo
urce);
var Target = document.getEle
mentById(ctrlTa
rget);
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(S
ource.options.s
electedIndex); //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.c
ount giving 0 can anyone tell me why this happening and also when post back occurs listbox items lost.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Client side data lose when posback occurs in asp.net c#
about table