TECHNOLOGIES: Client Events | Server Controls
Hook Client Events to Server Controls
Pick up three quick techniques to fire up server controls from the client side.
By Brad McCabe
Looking to hook client events to server controls? Well, you can take a variety of approaches. The easiest is when the control doesn't have a server event with the same name. All you need to do is put the client event on the tag:
<asp:Image onMouseOver="alert('Mouse Over')" ... />"
For objects, as a button, you can hook them to client events by adding attributes from your server-side code. This is some basic code you might add in your page load event:
Brad McCabe is the technical evangelist for Infragistics. Brad also has been a systems architect and consultant for Verizon Communications and many other clients, and he was a leading .NET evangelist within Ajilon Consulting. His primary interests include ASP.NET, Windows CE .NET, .NET Compact Framework, and Microsoft's networking technologies. E-mail him at mailto:[email protected].