Search:
Namespaces
Discussions
.NET v1.1
Feedback
Modifying controls client-side
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngclient' list
.
David Turner
I have two listboxes on a form. Client side, I'm allowing the user to move
elements back and forth from each listbox. I'm using javascript that uses
the document.createElement, and the options collection of each listbox to
add and remove options. Problem is that when I post back, the items
collection of each of these controls does not reflect the options that were
added or removed client-side. Any thoughts on why this is. To work around
this, I'm doing a post-back every time they select to move options, but this
seams like a lot of overhead just to move an item from one listbox to
another.
Reply to this message...
Matthew Tamm
my thoughts on this are....although your adding/removing elements on the client, when you postback, the controls contents are being re-created from the viewstate, not the form's contents....Not too sure on a way around this one, besides doing the postback.
----- Original Message -----
From: David Turner
To: aspngclient
Sent: Friday, August 09, 2002 12:28 PM
Subject: [aspngclient] Modifying controls client-side
I have two listboxes on a form. Client side, I'm allowing the user to move elements back and forth from each listbox. I'm using javascript that uses the document.createElement, and the options collection of each listbox to add and remove options. Problem is that when I post back, the items collection of each of these controls does not reflect the options that were added or removed client-side. Any thoughts on why this is. To work around this, I'm doing a post-back every time they select to move options, but this seams like a lot of overhead just to move an item from one listbox to another.
Reply to this message...
Andy Smith
this is a limitation of the html select element. It does not postback to the server its entire list, only it's selected item.
In order for this to work the way you want, you should probably create a subclass of
ListBox
that stores its clientside item changes in hidden var(s) which is then loaded in a rewrite of LoadPostBackData.
__
Andy Smith
Keyboard Jockey #3a7-2.78.1
-----Original Message-----
From: Matthew Tamm [mailto:
Click here to reveal e-mail address
]
Sent: Friday, August 09, 2002 11:49 AM
To: aspngclient
Subject: [aspngclient] Re: Modifying controls client-side
my thoughts on this are....although your adding/removing elements on the client, when you postback, the controls contents are being re-created from the viewstate, not the form's contents....Not too sure on a way around this one, besides doing the postback.
----- Original Message -----
From: David <mailto:
Click here to reveal e-mail address
> Turner
To: aspngclient <mailto:
Click here to reveal e-mail address
>
Sent: Friday, August 09, 2002 12:28 PM
Subject: [aspngclient] Modifying controls client-side
I have two listboxes on a form. Client side, I'm allowing the user to move elements back and forth from each listbox. I'm using javascript that uses the document.createElement, and the options collection of each listbox to add and remove options. Problem is that when I post back, the items collection of each of these controls does not reflect the options that were added or removed client-side. Any thoughts on why this is. To work around this, I'm doing a post-back every time they select to move options, but this seams like a lot of overhead just to move an item from one listbox to another.
| [aspngclient] member
Click here to reveal e-mail address
= YOUR ID |
http://www.aspfriends.com/aspfriends/aspngclient.asp
= JOIN/QUIT
Reply to this message...
System.Web.UI.WebControls.ListBox
System.Windows.Forms.ListBox
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com