Click here to Skip to main content
16,004,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,
I am using below code to create Ajax ComboBox dynamically and I want to assign onchange event using javascript for comboBox. Even I am assigning onchange event but nothing happens.
AjaxControlToolkit.ComboBox cmb = new AjaxControlToolkit.ComboBox();
cmb.RenderMode = AjaxControlToolkit.ComboBoxRenderMode.Block;
cmb.Attributes.Add("onchange", "javascript:alert(this);");
....


I would appreciate to know how to assign onchange event "SelectedIndex Change Event" using javascript?

Thanks.
Posted
Updated 20-Dec-10 19:40pm
v2
Comments
Kirankumar Ballapalli 13-Jan-11 1:12am    
Hi,

Set the property as AutoPostBack=true for Combobox.
Then you will get the alert.

Regards,
Kiran.

1 solution

I am sorry if i am wrong.I am unable to find a OnChange for ajaxcontroltoolkit combobox(dll version 3.5).Not sure if 4.0 has that.Instead try OnSelectedIndexChanged event of same control.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900