Skip to Main Content
Professional Visual Studio® 2008
book

Professional Visual Studio® 2008

by Nick Randolph, David Gardner
July 2008
Intermediate to advanced content levelIntermediate to advanced
1026 pages
27h 59m
English
Wrox
Content preview from Professional Visual Studio® 2008

30.4. Settings

In the .NET Framework v2.0, the concept of settings with a User scope was introduced to allow per-user information to be stored between application sessions. For example, window positioning or theme information might have been stored as a user setting. Unfortunately, there was no way to centrally manage this information. Meanwhile, ASP.NET Application Services had the notion of profile information, which was essentially per-user information, tracked on a server, that could be used by web applications. Naturally, with the introduction of the client application services, it made sense to combine these ideas to allow settings to be saved via the Web. These settings have a scope of User (Web).

As with the membership and role services, you need to enable the profile service for access by the client application services. You do this by adding the <profileService> element to the <system.web.extensions> element in the web.config file.

<system.web.extensions>
         <scripting>
                <webServices>
                        <profileService enabled="true"

readAccessProperties="Nickname"

writeAccessProperties="Nickname" />
                        <authenticationService enabled="true" requireSSL="false"/>

Following the previous examples, we will build a custom profile provider that will use an in-memory dictionary to store user nicknames. Note that this isn't a good way to track profile information, as it would be lost every time the web server recycled and would not scale out to multiple web servers. Nevertheless, you need to add a new ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional Visual Studio® 2010

Professional Visual Studio® 2010

Nick Randolph, David Gardner, Michael Minutillo, Chris Anderson

Publisher Resources

ISBN: 9780470229880Purchase book