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

Profile Service

ASP.NET 2.0 Application Services introduced Profile objects. As explained in part one of this series, Profile object holds data per user in an application. That data is stored inside the database and it is preserved for all visits.

To enable accessing those Profile objects in the Windows client application, there should be a way to tell the Windows client application where to load and where to save those Profile objects.

First of all, we will configure the ASP.NET host application to enable Profile service and add a few Profile objects that we will import later on to the Windows client application.

Start with adding the following XML configuration to the Web.config configuration file.

Listing 1

        <authenticationService enabled="true" requireSSL = "false"/>
        <roleService enabled="true"/>
        <profileService enabled="true"
          writeAccessProperties="LastLoginDate,Back_Color" />

The new section added in here is enabling the ASP.NET 2.0 AJAX 1.0 Extensions Profile service and configuring two Profile objects for read and writes by the client, whether the client is an AJAX or a Windows client application.

When the application is an AJAX one, a client-side proxy is created that points to the Profile_JSON_AppService.axd HttpHandler. This handler will execute on the server and access the Profile provider configured.

Once the ASP.NET 2.0 AJAX 1.0 Extensions application services are configured, the Profile service should also be enabled and configured as follows.

Listing 2

<profile enabled="true" >
        <add name="LastLoginDate" type="DateTime"
          readOnly="false" serializeAs="String" allowAnonymous="false" />
        <add name="Back_Color" type="System.String"
          readOnly="false" serializeAs="String" allowAnonymous="false" />

This is a typical Profile service configuration for an ASP.NET 2.0 application. First of all, Profile service is enabled then two Profile objects were configured and added. Nothing new in here!

View Entire Article

User Comments

No comments posted yet.

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

©Copyright 1998-2023  |  Page Processed at 2023-10-01 12:26:25 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search