I would like to ask how can i make an html anchor (a element) or even any object to do a postback or to execute an server side method?
I want to create a custom button (a wrapped with some divs to do some custom them) and i want to implement OnClick to be look like the ASP.NET LinkButton?
Like
<a href="#" onclick="RunServerSideMethod()">Just a simple link button</a>
By default, controls use __doPostBack to do the postback to the server. __doPostBack takes the UniqueID of the control (or in HTML, the name property of the HTML element). The second parameter is the name of the command to fire.
So for a custom button, render to the output stream:
In your custom button, add the
IPostBackEventHandler, and this__doPostBackstatement will fire itsRaisePostBackEventmethod automatically for you.