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

Simple question regarding postback and viewstate

I have created a web form with 3 different inputs, 1 drop
down and 2 list boxes. The drop down selection populates
the two list boxes, and I can get this render once, no
problem, I now want to change the contents, of either
list box based upon multiple selections in the list
boxes. In short I want to re-render the list box's
contents, based on the list box choices, UNFORTUNATELY,
it seems to only appned new choices, and not re-write the
result set as desired. Any body have any idea?

thanks

dave
Nov 15 '05 #1
2 1180
More simply put.

Is there a way to reset the following:

ListBox.Items.Add(memberfirst[h]);

I have tried

ListBox.Items.Insert(h,memberfirst[h]);

and puts the new entries at the beginning, and won't get
rid of the old entries.
Is there a way to reset ListBox.Items, each time the
button is clicked?
-----Original Message-----
I have created a web form with 3 different inputs, 1 dropdown and 2 list boxes. The drop down selection populates
the two list boxes, and I can get this render once, no
problem, I now want to change the contents, of either
list box based upon multiple selections in the list
boxes. In short I want to re-render the list box's
contents, based on the list box choices, UNFORTUNATELY,
it seems to only appned new choices, and not re-write theresult set as desired. Any body have any idea?

thanks

dave
.

Nov 15 '05 #2
Hi Dave

How are you adding the items to the listbox. are you doing databinding??? because if you are doing databinding then i guess you can rebind the datasource and that should work

Let me know how you are adding the items..

Regards
Madh

MVP | MCSD.NE

----- dave wrote: ----

I have created a web form with 3 different inputs, 1 drop
down and 2 list boxes. The drop down selection populates
the two list boxes, and I can get this render once, no
problem, I now want to change the contents, of either
list box based upon multiple selections in the list
boxes. In short I want to re-render the list box's
contents, based on the list box choices, UNFORTUNATELY,
it seems to only appned new choices, and not re-write the
result set as desired. Any body have any idea

thank

dav

Nov 15 '05 #3

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

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
3
by: Maria | last post by:
Hi I have a asp:table that I want to hold the values between postbacks. Hope some one knows how I can get that to work in an easy way. The table is loaded in runtime with different textboxes....
2
by: Earl Teigrob | last post by:
I have run into a situation where I need to run the !IsPostBack code under one circumstance, even if it is a postback. Something that may complicate matters more is that this is a double postback...
10
by: Calvin X | last post by:
Hi all I have the following code in the page load event. The function in this code works get to populate the 4 dropdownlists on my webform. I have enabled postback because when the user selects...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
1
by: John Cosmas | last post by:
I've got a page which loads up a different user control into a placeholder control every time a button is clicked on the parent page. I use a statement like...
6
by: msnews.microsoft.com | last post by:
Hello All, I am very new to ASP.NET and I have a basic question. Can somebody please explain? I have an .aspx Web Page with a textbox control. When the Page initially loads I am calling a...
9
by: Nad | last post by:
Hello, I have a textbox control with EnableViewState=false I also have a datalist within a Panel in the same form with EnableViewState=false The datalist is filled using an SqlDataAdaptor. ...
4
by: Mark Olbert | last post by:
This involves a family of related, databound ASPNET2 composite controls. I've managed to arrange things so that the composite controls restore themselves from ViewState on postback after they're...
4
by: Dan | last post by:
Hi, i'm not sure to understand the difference between refreshing the pagina by clicking on 'refresh' in the browser and a postback. What i think it is: Suppose a page with a form containing a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.