I’m using VS2010,C# to develop my ASP.NET web app, I’ve implemented an internal communication page which acts like email systems, of course recipients can be selected from a combo box which lists user names of the system.
Is there any way that I can use client side (JavaScript) to detect selected item of my combo box, so that I can disable combo box autopostback (post backing to the server takes a lot of time and can annoy the user). I want to write name of the selected user (i.e. combo box selected item) in a table (so that user can see the recipient list). There can be any number of selection from the combo box (of course there is always one item selectable at a time).
also user should be able to remove each recipient by click on its name, meanwhile I want to have list of selected users in server side, I should use hidden tag?
I’ve seen above scenario in another site working with ASP.NET and it was really smooth, so I’m going to implement it.
thanks
all you need to use is
JQueryand read some articles, for example check this one:http://elegantcode.com/2009/07/01/jquery-playing-with-select-dropdownlistcombobox/
examples:
get currently selected value:
execute some code when selected item changes:
programmatically set selected item: