08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

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.

292<br />

CHAPTER 12 ■ <strong>AJAX</strong> EXTENSIONS FOR <strong>ASP</strong>.<strong>NET</strong><br />

Figure 12-9. <strong>ASP</strong>.<strong>NET</strong> application using Ajax<br />

Building a Simple Ajax Application with <strong>ASP</strong>.<strong>NET</strong><br />

Now, the example of adding two numbers is all very good, but how does <strong>ASP</strong>.<strong>NET</strong> <strong>AJAX</strong><br />

stack up when writing a more typical <strong>ASP</strong>.<strong>NET</strong> page—for example, one that uses a<br />

DataGrid to bind to a back-end data source<br />

■Note If you are amending an existing <strong>ASP</strong>.<strong>NET</strong> application to use Ajax, you should remember that some<br />

changes to your <strong>Web</strong>.config file will need to be made to reference the <strong>AJAX</strong> libraries. A good shortcut is to<br />

create a new <strong>ASP</strong>.<strong>NET</strong> <strong>AJAX</strong> application <strong>and</strong> copy the information from its <strong>Web</strong>.config file.<br />

Let’s put this together now. First, create a new web form <strong>and</strong> add a SqlDataSource<br />

control to it. Open the SqlDataSource Tasks pane, as shown in Figure 12-10.<br />

Figure 12-10. Adding a SqlDataSource to an Ajax application

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

Saved successfully!

Ooh no, something went wrong!