Simply put, DirectEvents are server-side event handlers for events triggered on the client side. DirectEvents can be applied to Ext.NET Controls, ASP.NET controls, and even any HTML elements on the page. Off-page services can also be invoked by DirectEvents. As mentioned in Chapter 2, Ext.NET Controls Overview, it is important to note that for a DirectEvent to work, the Ext.NET control has to be recreated on the server first, just like you do with ASP.NET controls in a traditional ASP.NET Post Back model using the full page lifecycle. If the ASP.NET Web Forms page has a form with runat="server"
, then that entire form will be submitted by default.
In Chapter 2, Ext.NET Controls Overview, we saw how various controls can raise events that can be handled on the client side using JavaScript event handlers. We also saw a quick example of handling events on the server side instead. We will revisit this here. Consider this snippet of Ext.NET:
<ext...