Want to fire Dropdown SelectedIndexChanged Event in Javascript

后端 未结 4 586
春和景丽
春和景丽 2021-01-13 01:38

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

4条回答
  •  悲&欢浪女
    2021-01-13 01:58

    Call onchange method like that at client side :

    document.getElementById('yourDropdownsClientId').onchange();
    

    EDIT : If you set your dropdown's AutoPostBack property to true, the code above will post your page to server, than your server side event will be called.

    But If you want to call your event manually, you can all it anywhere in your page's codebehind like that :

    myDropDownList_SelectedIndexChanged(null, new EventArgs());
    

提交回复
热议问题