By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,537 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,537 IT Pros & Developers. It's quick & easy.

populating listbox on the server

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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: n/a
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

P: n/a
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: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.