BT

Create Your Own ASP.NET Providers

by Jonathan Allen on Oct 15, 2006 |

With version 2.0, ASP.NET has allowed developers to create their own custom providers that plug into the website framework. These providers cover the areas of Membership, Roles, Site Map, Session State, Profile, Web Event, and Web Parts.

The first option is to base your custom version on the built-in versions. Fortunately Microsoft has released the complete source code for the SQL Providers as well as extensive documentation. Scott Guthrie has collected the key resources to get you started.

Not all developers are satisfied with this option. In theory it is possible to modify the SQL Providers to work with your existing infrastructure. But as Michal Valášek says, 

[The] database structure used by these providers is pretty complicated and almost impossible to interconnect with your own tables etc. Drop the “almost” for profile provider.

To address this, he has released the Altairis Simple ASP.NET SQL Providers through CodePlex. They provide the minimum functionality needed to work with the framework and a very simple table structure. This makes them ideal for grafting onto your existing infrastructure. Currently providers for Membership, Role, and Profile are available. They are written in C# and only require one or two tables each.

While in theory a developer can swap out any provider, sometimes there are internal dependencies that have to be considered. For example, the Hao Kung's Table Profile Provider is coupled to the default Membership provider.

For those working with database other than SQL Server, there are options. Rakotomalala Andriniaina has offered source code for Membership and Role providers for MySQL.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT