I’m trying to call a button’s OnClick event from jQuery. Here is a simplified version to demonstrate:
This calls the client side method Test2(). But I want to fire the server side event OnClick. I only added Test2() as nothing was happening and I suspected that $("#<%=Button2.ClientID%>").click(); was trying to fire a client side event. I changed it to various
versions similar to: $("#<%=Button2.ClientID%>").onclick(); but nothing has worked yet.
Please help if you can.
You need to hook up the server event. You need to specify the onclick handler. Currently the button has no handler specified.
Can you show how I specify the onclick handler please?
Like the onclick that you have in button2. Plus the actual handler in the code behind which button2 should have. So follow what you’ve done for button2 basically.