ListBox Click or DoubleClick event for web apps

O

OfurGørn

Hi

I am trying to make a listbox in a c# web application that updates some data
on the page when an item in the list is clicked. This is easy on a
traditional listbox (in a form application) - using the Click event, but the
Click or DoubleClick event is missing on the web version of the ListBox.

I suspect there is a very simple solution to this problem, but I am not
seeing it.....

I am pretty sure someone out there has encountered this before, and has an
accepatble solution.

Looking forward to hearing something

________________________
Gunnar Gudmundsson
 
P

Patrice

First keep in mind that it would mean that you postback the form each time
you click in the list. This is not the usual behavior in particular in a web
UI.

Generally this would rather be done client side to avoid a server round trip
each time you do something on the form.
 
O

OfurGørn

Hi Patrice.
I am aware of that, as the data to be diplayed is on the server.
________________________
Gunnar Gudmundsson
 
P

Patrice

Ok just wanted to make sure before.

You can just the SelectedIndexChanged event. You have just to set the
Autopostback property to true so that selecting another value will submit
the form allowing to handle the event immediately server side.
 
O

OfurGørn

thanks Patrice. Works like a charm.

This is the simple solution I was overlooking... Irritating how the simple
ones are often hard !

________________________
Gunnar Gudmundsson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top