Search code examples
asp.netcomboboxobout

Obout Combobox events only fire on page load


I have the following obout control on my page:

<cc1:ComboBox ID="ActivityTypeComboBox" runat="server" Width="100" AllowEdit="False">
    <ClientSideEvents OnSelectedIndexChanged="alert('x')" OnItemClick="alert('y')" />
</cc1:ComboBox>

Both of the ClientSideEvents fire when the page first loads but not after that when I actually do the events.

Any idea why or what I am missing or doing wrong?

Thanks!


Solution

  • Don't know about "Obout" controls, but at least for Infragistics ones the ClientSideEvents only contain the function names, not actual JavaScript code.

    If I'm correct, you'd have to do something like this:

    <cc1:ComboBox ID="ActivityTypeComboBox" runat="server" Width="100" AllowEdit="False">
        <ClientSideEvents OnSelectedIndexChanged="onActivityTypeChanged" OnItemClick="onActivityTypeClicked" />
    </cc1:ComboBox>
    

    Then in JS:

    function onActivityTypeChanged()
    {
        //...
    }
    
    function onActivityTypeClicked()
    {
        //...
    }
    

    The JS functions might also get some additional parameters from the control, but you'd have to consult the documentation for that.