Yea, I've thought of that. That will work to some degree,
but it's still just a little bit less cludgy than what
I've already got working.
I wish there was a way for the codebehind to pick up what
values are populated in various dropdowns via client-side
javascript, without having to write all of these custom
code hacks.
The other option I looked at was moving all of our
existing server side control validation routines to client-
side javascript. Then the page could only be submitted
when it was actually DONE. This would prevent the need
for separate state management mechanisms for javascript
populated select boxes, because there would be no need to
redisplay the form the user fills out. Either the form is
posted processed or a client side validation script would
halt the form post.
Once again more javascript. Yuck! There's got to be a
better way to marry the robust responsiveness of client-
side scripting and server-side ASP.Net functionality.
This all-or-nothing (client-side vs. server-side) coding
methodology really bugs me!
-----Original Message-----
Hi Allan,
Although I haven't tried it, I'm wondering whether you
could use a hiddenserver-side input box as a storage area for the populated
data. Unlike thedropdownlist boxes, input boxes are meant to collect user
data.
Maybe you could store the values in some type of
delimited string"blue|red|black" that you could parse on the postback and
add to thelistbox?
I could be way off the mark here, but thought I would
raise the possibilityin case in sparks something else that suits.
"Allan M." <an*******@discussions.microsoft.com> wrote in
messagenews:05****************************@phx.gbl... I have a series of select boxes that must be populated
client side, because they interact with each other. The
design specification calls for these boxes to be updated
without having to make a roundtrip to the server.
The codebehind seems to be unaware of select box members
populated via javascript. So, I'm having to create my
own state management solution, (i.e. rewriting the VIEWSTATE
mechanism) to persist the state of these select boxes
after a postback occurs.
Is there an easier or better way to do this client-side?
Note: Postback is not an option. That is the way the
code was originally written, but end users were very
unhappy with round trips to server.
I need a way to be able to update controls using
javascript and include the information in the viewstate
whenever a postback occurs. Is this possible, or is
mixing client-side and server-side form manipulation
code just not done in ASP.NET?
Thanks...
.