473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

javascript change lost on postback

Hello all,
I have a page that contains two listboxes and an "Add" button. When
clicked, the button fires javascript that moves the selected item(s) in the
first listbox to the second listbox and removes it from the first. This
works perfectly right now. The problem is that when I click the "Save"
button to save the values in the second listbox back to my DB, my C# doesn't
see anything in the second listbox and sees all the original values in the
first one.
I've already double checked to make sure that I'm not accidently overwriting
the values on postback.
Any ideas on why it won't remember the javascript change and/or how I can
get it to work?

Thanks!
Sep 5 '06 #1
1 2259
This is just a guess but I think the reason your application doesnot
find anything in the second listbox is because the javascript is not
updating the viewstate and the changes you make are lost during
postback when the Save button is clicked.
Solution: try using server SelectedItemChanged event on listbox

Tom S. wrote:
Hello all,
I have a page that contains two listboxes and an "Add" button. When
clicked, the button fires javascript that moves the selected item(s) in the
first listbox to the second listbox and removes it from the first. This
works perfectly right now. The problem is that when I click the "Save"
button to save the values in the second listbox back to my DB, my C# doesn't
see anything in the second listbox and sees all the original values in the
first one.
I've already double checked to make sure that I'm not accidently overwriting
the values on postback.
Any ideas on why it won't remember the javascript change and/or how I can
get it to work?

Thanks!
Sep 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
12
by: Mark Fox | last post by:
Hello, I am attempting to do something very simple. I have a page MainPage.aspx and a popup window Popup.aspx. When users click on the linkbutton in the popup window I am looking to do some...
2
by: pl | last post by:
1) build drop down list on server 2) manipulating lists on the client using javascript 3) when postback to server, lost the values that were manipulated on the client. 4) how we defined to client...
3
by: James | last post by:
I have up and down buttons on my web form which execute Javascript to move the selected list item up or down in the list. However, when I post the form back to save the list order in a database,...
4
by: Henrik Holle | last post by:
Hi, i have a serverside listbox but i modify the value with javascript on the clientside. On postback my changed/added values are all lost? what am i doing wrong? Is it not possible to change...
7
by: Irfan Akram | last post by:
Hi People, I have got a simple question to ask. I am trying to build dynamic controls in asp.net. I have managed to build them successfully. I have also managed to add the event handlers to all...
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
4
by: Mario Vargas | last post by:
Hello all, I am trying to dynamically add elements to a select list (which is running on the server, runat="server") with JavaScript, but when I postback, the new elements are lost. I'm not sure...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm in a gridview edit row that has a DropDownList in one column and a status Label in the 2nd column. When i changed the value in the dropdownlist, there's a client-side javascirpt...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.