JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Forcing Event Handling

As discussed in the In Depth section of this chapter, some events, like Click, cause a Web form to be sent back to the server for event processing, and some, like SelectedIndexChanged in a list box, don't. Sending a Web form back to the server for processing is called posting it back to the server. Events that aren't automatically posted back to the server are stored and processed when the form is posted back to the server (so, for example, a SelectedIndexChanged event would be handled when a Click event occurs elsewhere in the page).

To force a control's events to be automatically posted back to the server, and so handled at once, you set the control's AutoPostBack property to True. That's all it takes. (This adds the attribute runat = "server" to the control's HTML.)

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor