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

populating listbox on the server

P K
I have a listbox which I am populating on the client (it contains a list of
dates selected from calender). The listbox is a server control.
When I get to the server after postback by selecting an item in the list,
the list box cannot be accessed.
How do I repopulate the listbox on the server after postback and be able to
access the elements?
Nov 19 '05 #1
6 1543
what do you mean it cant be accessed? Is there an error?
Could you show the code you are using.
You should be able to loop through the Items collection on it, as long as
you aren't wiping the values with the postback prior to reading them.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"P K" wrote:
I have a listbox which I am populating on the client (it contains a list of
dates selected from calender). The listbox is a server control.
When I get to the server after postback by selecting an item in the list,
the list box cannot be accessed.
How do I repopulate the listbox on the server after postback and be able to
access the elements?

Nov 19 '05 #2
P K
When I say the list box cannot be accessed, I mean that on the server the
listbox shows that there are no items in it.
The items in the list were populated on the client side using javascript and
no server binding was done

"Curt_C [MVP]" wrote:
what do you mean it cant be accessed? Is there an error?
Could you show the code you are using.
You should be able to loop through the Items collection on it, as long as
you aren't wiping the values with the postback prior to reading them.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"P K" wrote:
I have a listbox which I am populating on the client (it contains a list of
dates selected from calender). The listbox is a server control.
When I get to the server after postback by selecting an item in the list,
the list box cannot be accessed.
How do I repopulate the listbox on the server after postback and be able to
access the elements?

Nov 19 '05 #3
Try this sample: http://www.societopia.net/samples/li...lientside.aspx

You need to manage the ViewState of the added ListItems.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"P K" wrote:
When I say the list box cannot be accessed, I mean that on the server the
listbox shows that there are no items in it.
The items in the list were populated on the client side using javascript and
no server binding was done

"Curt_C [MVP]" wrote:
what do you mean it cant be accessed? Is there an error?
Could you show the code you are using.
You should be able to loop through the Items collection on it, as long as
you aren't wiping the values with the postback prior to reading them.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"P K" wrote:
I have a listbox which I am populating on the client (it contains a list of
dates selected from calender). The listbox is a server control.
When I get to the server after postback by selecting an item in the list,
the list box cannot be accessed.
How do I repopulate the listbox on the server after postback and be able to
access the elements?

Nov 19 '05 #4
P K
Thanks ..That helps

"Phillip Williams" wrote:
Try this sample: http://www.societopia.net/samples/li...lientside.aspx

You need to manage the ViewState of the added ListItems.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"P K" wrote:
When I say the list box cannot be accessed, I mean that on the server the
listbox shows that there are no items in it.
The items in the list were populated on the client side using javascript and
no server binding was done

"Curt_C [MVP]" wrote:
what do you mean it cant be accessed? Is there an error?
Could you show the code you are using.
You should be able to loop through the Items collection on it, as long as
you aren't wiping the values with the postback prior to reading them.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"P K" wrote:

> I have a listbox which I am populating on the client (it contains a list of
> dates selected from calender). The listbox is a server control.
> When I get to the server after postback by selecting an item in the list,
> the list box cannot be accessed.
> How do I repopulate the listbox on the server after postback and be able to
> access the elements?

Nov 19 '05 #5
On Wed, 09 Nov 2005 09:22:02 -0800, Curt_C[ MVP] wrote:
what do you mean it cant be accessed? Is there an error?
Could you show the code you are using.
You should be able to loop through the Items collection on it, as long as
you aren't wiping the values with the postback prior to reading them.

I am interjecting here :(. However, it seems that what is happening here
is that the listbox entries are generated by the client. The server has no
idea about them.

Nov 19 '05 #6
On Wed, 09 Nov 2005 12:09:18 -0800, Phillip Williams wrote:
Try this sample: http://www.societopia.net/samples/li...lientside.aspx

You need to manage the ViewState of the added ListItems.


Look like a doable hack.

Nov 19 '05 #7

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

Similar topics

3
by: Broder | last post by:
Hi there, I am currently running into a somewhat weired problem and hope that this NG is able to help ;-) I have a table in a MSSQL Server in which there is one Column that stores a date. The...
0
by: Bill Brinkworth | last post by:
I want the user to type in part of a word, and I want to return all words from an Access word table that contains specified letters. If they were to type "fe??", it should return all words in the...
2
by: collie | last post by:
Hi, I have 2 listboxes. The first gets populated from the db as soon as the page loads. The second listbox get populated based on the user's selection from the first listbox. However,...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
6
by: Casey | last post by:
hello, I need to populate a drop down list when the user clicks on the arrow button. how do i do this. Should i use a html select control or is it possible using the asp:dropdownlist
8
by: jack-b | last post by:
Hi, I have a list box which displays countries names and a second listbox which displays their cites (based on the selection made in ListBox 1) If the user selects USA i want to display cities...
1
by: CraigMuckleston | last post by:
I have the following php code that retrieves a list of items. I want to populate a listbox with the XMLHttpRequestObject, but I am getting 1 long string instead of each item on a line. How can I...
2
by: NvrBst | last post by:
I populate a ListBox with a LogFile that has about (~1000 lines). The ListBox's datasource is a BindingList<string>. Whenever I add the elements, with the datasource set, it takes about 2 mins. ...
1
by: TG | last post by:
Hi! I am using VB 2008 with SQL Server 2000 and SQL Server 2005 (depending which server the user selects to connect to). I have a listbox in which the user select the server to connect to. ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.