13.07.2015 Views

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

ASP.NET 3.5: A Beginner's Guide - www.mustafaof.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 17: <strong>ASP</strong>.<strong>NET</strong> Ajax 425Figure 17-2 Ajax-enabled web sitequickly the text appears. Now load up and test the non-Ajax version, Old School, and<strong>com</strong>pare the two. The difference is that only the text was posted back in the Ajax version,not the whole page.When you run examples of your local host, they do not go through the routers andother time-consuming gates that typically happen in production use. As a result, theAsk the ExpertQ: In the Ajax example, no event handling code was entered for the button. How is itpossible for the button to keep passing the contents of the TextBox control to theLabel control using the Page_Load event handler?A: When the button is pressed, it generates a post-back. The page thinks that with the useof the default Load_Page, a new page is loaded, so it passes the values of the TextBoxcontrol to the Label control. By and large, that is not a re<strong>com</strong>mended practice. See thesection “Using Events with Ajax” later in this chapter.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!