Skip to content

Want to fire Dropdown SelectedIndexChanged Event in Javascript

I have dropdown on my page, I am changing selected value of dropdown from popup window using Javascript. I have some logic in dropdown SelectedIndexChanged event, so I need to fire the SelectedIndexChanged event when dropdown selection changed from Javascript.

Answer

document.getElementById('<%= yourDropdown.ClientID %>').onchange();

This should work, if you are still getting some error, you can try like this:

setTimeout('__doPostBack('yourcontrolClientSideID','')', 0);

yourcontrolClientSideID is the ID of Rendered Client ID.