Aaron Goldenthal

Sometimes ASP.NET is Rocket Science

How to Change the Selected Value of a < select > in Javascript and Raise the onchange Event

I had a project recently where I wanted to change the selected value of an ASP.NET DropDownList via Javascript and force a postback to trigger an UpdatePanel refresh.  Since AutoPostBack was set to true for the DropDownList, I expected the postback to occur automatically.  What I learned through this is that the select’s change event is only fired when the user changes the selection, not when it’s done through Javascript, so the postback never occurred.  After a little... [More]