Client Application Services - Part 1
page 3 of 7
by Bilal Haidar
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 47122/ 85

ASP.NET 2.0 AJAX Extensions 1.0 Application Services

AJAX Extensions 1.0 shipped with built-in client-side Application Services. This means that with AJAX 1.0 Extensions you can authenticate users, process user roles, and load and save user’s profile without the need to postback to the server.

To be able to allow the client-side code to interact with the Application Services, you need to configure them in the Web.config configuration file as follows.

Listing 2

        <authenticationService enabled="true" requireSSL = "false"/>
        <profileService enabled="true"
          writeAccessP-roperties="UserName" />
        <roleService enabled="true"/>

The above enables the Authentication, Profile, and Role services so that the AJAX engine creates client-side proxies so that the client-side JavaScript can interact with the Application Services on the server in an asynchronous way.

Every client-side proxy for the above services is configured with HttpHandler to know where to post the asynchronous request on the server. For instance, the Authentication Service is configured with the Authentication_JSON_AppService.axd HttpHandler. When a request accesses the aforementioned HttpHandler, the handler checks what Membership provider is configured in the web application on the server and accordingly it redirects the request to that configured provider. For instance, a call to Login method on the HttpHandler would be redirected to the Login method implementation of the configured Membership provider in the Web.config configuration file of the application

You can also configure the application services to interact with your Web services instead of using the built-in HttpHandlers. This can be very easy and a matter of setting the path of the Web services that will do the authentication operations to the Path property of the AuthenticationService class located inside the ScriptManager instance. Here is an example of how to do so.

Listing 3

<asp:ScriptManager ID="ScriptManager1" runat="server">
<AuthenticationService Path="~/AuthenticationService.asmx" />

After all, whether the client-side proxy is accessing a Web service, which is nothing but a compiled class on the server, or the HttpHandler which instantiates an instance of the configure MembershipProvider, the same functionality is present.

View Entire Article

User Comments

Title: Mgr Appplication Development   
Name: Jothi
Date: 2008-12-30 11:28:42 AM
Hi Bilal,
I would like to know if the same service can be used for multiple applications
Title: Client Application Services - Part 1   
Name: Safiyullah-India
Date: 2008-04-29 2:49:06 AM
hi bilal... its good

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-23 9:13:18 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search