Client side questions

  • Thread starter Thread starter Jerry Camel
  • Start date Start date
J

Jerry Camel

1. I can add a value to a listbox, but when the page posts back, I lose the
items I added from client side script. (Items added in server script stay
in the list.) I'm guessing it's a view state issue or something. How do I
add items to a listbox on the client side and have them acknowledged by the
viewstate process?

2. Is it possible to detect a doubleclick in a listbox on the client side?

Thanks.

Jerry
 
Hi,

1) it's not directly related to ViewState. Or sort of it is, but such that
generally DropDownList and ListBox ignore client side changes as normally
these controls post only the selection to the server (as their rendered HTML
elements do). The design is such that they are populated from the server,
means if you want to add item, you cause a postback. However, it's possible
to develop this feature and Andy Smith has developed a DynamicListBox
control which does exactly what you are looking for:
http://www.metabuilders.com/Tools/DynamicListBox.aspx

2) Yes it is, but you can't detect single click at the same time because
click will always override doubleclick (this in the case you cause a
postback when click occurs)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

1. I can add a value to a listbox, but when the page posts back, I lose the
items I added from client side script. (Items added in server script stay
in the list.) I'm guessing it's a view state issue or something. How do I
add items to a listbox on the client side and have them acknowledged by the
viewstate process?

2. Is it possible to detect a doubleclick in a listbox on the client side?

Thanks.

Jerry
 
Back
Top