Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

call server-side method from javascript in postback [duplicate]

Possible Duplicate:
Call ASP.NET Function From Javascript?

In my custom ajax server-side control I draw image (using html5) and I need to invoke server-side function when user click it (just do it usual button).I want to do it like this:

    <xx:MyControl ... runat="server" onchange = "server side function"/>

I dont want just invoke do_postback function with ControlId an EventArgument parametrs beckause then I must do additional work to specify the action and invoke appopriate function - I want to keep my code-behind clear and I dont want end user that will use my component do this work.

like image 465
Anton Putov Avatar asked Apr 27 '26 19:04

Anton Putov


1 Answers

You will need to implement IPostBackDataHandler interface, this and this article will guide you to accomplish this.

like image 135
Adil Avatar answered Apr 30 '26 10:04

Adil