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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 13 ■ <strong>AJAX</strong> SCRIPTS AND SERVICES 315<br />

allows you to continue presenting these services to your users without requiring non-<br />

Ajax full page refreshes. Using them is very straightforward, <strong>and</strong> the ScriptManager<br />

control is used to manage the generation <strong>and</strong> downloading of the correct proxies.<br />

In this section, you’ll first see how to add forms-based authentication to your<br />

<strong>ASP</strong>.<strong>NET</strong> <strong>AJAX</strong> site, <strong>and</strong> then you’ll go into accessing the profile services.<br />

Using Forms-Based Authentication in <strong>ASP</strong>.<strong>NET</strong><br />

Configuring forms-based authentication to use <strong>ASP</strong>.<strong>NET</strong> membership services is very<br />

straightforward, <strong>and</strong> very well h<strong>and</strong>led for you by the framework. In this section, you’ll go<br />

through, step by step, how to create a simple site that uses membership, authentication,<br />

<strong>and</strong> roles, <strong>and</strong> how <strong>ASP</strong>.<strong>NET</strong> <strong>and</strong> Visual Studio 2005 enable this for you. You’ll then take<br />

what you’ve learned in this section to the next, where you will access the membership<br />

<strong>and</strong> profile data directly from JavaScript using your Ajax code.<br />

Step 1: Creating a New <strong>Web</strong> Site Application<br />

To get started, create a new <strong>ASP</strong>.<strong>NET</strong> <strong>AJAX</strong>–enabled web site in Visual Studio 2005. Use<br />

the HTTP location so that the site runs on IIS instead of the Cassini server. Call the site<br />

FormsSecured. Your dialog should look something like that in Figure 13-1.<br />

Figure 13-1. Creating a new web site in Visual Studio 2005

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

Saved successfully!

Ooh no, something went wrong!