Handling Postback Events

Only one control in a page at a time can cause a form to be submitted back to the server. When a control initiates a postback, the control can raise a postback event.

To process a postback event, you need to implement the IPostBackEventHandler interface. This interface includes a single method:

RaisePostBackEvent() Called on the server when a control initiates a postback.

The control in Listing 36.18 illustrates how you can implement the IPostBackEventHandler interface.

Listing 36.18. CustomLinkButton.cs

images

images

The control ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.