tailieunhanh - Beginning Ajax with ASP.NET- P17

Beginning Ajax with P17:Thank you for purchasing Beginning Ajax with . We know that you have a lot of options when selecting a programming book and are glad that you have chosen ours. We’re sure you will be pleased with the relevant content and high quality you have come to expect from the Wrox Press line of books. | Chapter 9 Switch back to the design view and double-click the btnLongRequest button. This action will switch you to the code window and wire up a button click event method. Update the Manager class by inheriting from the class. The only other changes required for this demonstration are to add a short delay when the button is clicked and to print a message on the label when the request is completed. Notice that you are not setting the page s HiddenFormPostBack property. The Manager control is responsible for notifying the application that this page is Ajax-enabled. public partial class Manager protected void Page_Load object sender EventArgs e protected void btnLongRequest_Click object sender EventArgs e 5000 Done Now run the page to demonstrate its behavior. Experiment with the manager settings by changing the HiddenRequestTimeout property to 3 in the ASPX file. This allows the page to time out before the server is done processing and you see how the framework will notify the user of a timeout. Change the DisableFormWhilePostBack property and note how the controls on the page are no longer disabled when you make a call to the server. Finally you can see the effect of the TransferDifference property by setting it to false and clicking on the button. The demo version includes a bar graph that represents the amount of information sent across the wire. When TransferDifference is turned off you can see by the graph how much more data is transported to the client. Example 4 PanelUpdater Control Periodic Refresh The PanelUpdater is a control that allows you to target specific areas of a page to update. You may decide that you want to change the contents of a section of your page but the rest of the page should remain unchanged. The PanelUpdater wraps up many of the implementation details allowing you to easily access page .

TỪ KHÓA LIÊN QUAN