473,289 Members | 1,963 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,289 software developers and data experts.

ASP.NET, Listboxes, Javascript and the Viewstate


have a problem and I'm not sure how to handle/fix it.

I have three listboxes on my page. The first listbox has a list of software
products. When you select an item in the Products listbox, then the two
other listboxes fill up with choices, one has related versions of that
product, and the other has related Categories. Pretty typical stuff.

Anyway, when I first designed the page, I used ASP.NET code to fill the
values of the Version and Category listboxes whenever the Product listbox
was clicked I had the AutoPostback of the Products listbox set to true), and
this worked and submitted just fine. When I submitted the page, all the
versions and categories were properly submitted. (I should also mention that
all three of the listboxes are MULTI select, and will almost always have
mutiple items selected the way we use them).

But this caused a lot of postbacks, and thus a lot of server round-trips,
which is wasteful and annoying. So I wrote some javascript code to handle
loading the version and category listboxes. This works great, and no post
backs. But when I go to submit the page, not all the selected items show up.
Only the items that were displayed when the page initially loaded get
submitted, otherwise, they don't seem to exist.

I assume this has something to do with Viewstate. I guess that the viewstate
is being queried as to what fields exist in the listboxes, as opposed to
looking at the actual form data.

Is there a way around this? I can always go back to the original model, but
I'd like to keep the javascript functionality if possible.
--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/
Nov 19 '05 #1
0 1559

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

Similar topics

2
by: nadia | last post by:
I am have used php to create a two sets of arrays of listboxes, each of the listbox in the array have a unique ID. One of the list boxes are dependant on the other one. I have written the code in...
3
by: Simon Templar | last post by:
I need the following functionality: With 2 listboxes populated from a database with the SAME data, I need any of the listboxes to stop displaying the option when selected at the other listbox. Eg:...
4
by: bill yeager | last post by:
I have several template columns inside of a datagrid. Inside of these template columns are databound listboxes: <asp:TemplateColumn HeaderText="Crew Chiefs"> <ItemTemplate> <asp:listbox...
5
by: Ken Varn | last post by:
Is it possible to interact with the ASP.NET ViewState using JavaScript? I would like to be able to access data in ViewState through JavaScript and also set ViewState data. Not sure if this is the...
0
by: Terry D | last post by:
I'm having an issue with an ASP.NET page (VS.NET 2003, VB.NET, Oracle back end). The page uses the standard VS.NET grid to display the records from a particular table. The user can edit certain...
1
by: Ryan Ternier | last post by:
I have two listboxes, and allow users to move items between them via the following function: function SwitchList(fbox, tbox){ var arrFbox = new Array(); var arrTbox = new Array(); var...
5
by: DC Gringo | last post by:
I have an asp.net vb page with two web user controls on it. The first user control, uc1.ascx has a series of list boxes that are populated in series by each other with ONSELECTEDINDEXCHANGED. ...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
3
by: Aussie Rules | last post by:
Hi. I am using Live Earth SDK, and have very little Javascript knowledge, but I need to insert values into a Javascript function, where the vales are in the ASP.net VB code. The javascript...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...

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.