For a <select>
control, we can use the onchange
attribute to run some javascript when the option value changes. Intellisense would lead me to believe that the asp:ListBox
control does not hold this attribute (as you'll get underlining in visual studio telling you that this is invalid). However, this works.
<asp:ListBox ID="roleList" OnChange="someJavascriptCall()" runat="server" Visible="true" Rows="3">
Try typing that code into visual studio, and you'll have your OnChange attribute calling you out. Why is this? Are there any side effects to using this attribute?