Having trouble triggering a dropdownlist event.
The dropdown in question:
asp:dropdownlist id="ddlhello" Runat="server" AutoPostBack="True" onchange="javascript:return ChangeHeader();"
An associated selectedindex change event has been added in the code behind.
The issue arises when the page is executed: JavaScript runs, but the server-side code does not trigger. Removing
onchange="javascript:return ChangeHeader();"
allows the server side code to work as expected.
Upon inspecting the source code, it appears that there are two onchange
events linked — one for JavaScript and another for server-side processing.
Seems like the client-side code is being prioritized over the server-side code.
Uncertain about the cause, seeking insight into this behavior.
In search of a solution that will execute both server and client-side code simultaneously.
Tried searching for answers without success so far.
Your assistance is greatly appreciated.