using membership providers for a web application

A

Andy Fish

Hi,

I am trying to figure out how to use asp.net membership providers for my
vs2005 web project. unfortunately the only walkthrough in MSDN uses the "Web
Site Administration Tool" to configure the providers, and that tool only
seems to be available for web sites, not web projects.

I can't figure out where the WSAT persists all the settings. the user and
group information seems to be all in a SQL server database but there is no
where to configure which database it uses.

is it possible to use membership providers with a web project? or was I
stupid to use a web project and should have been using a web application all
along? or was I stupid to try and use membership providers?

Thanks

Andy
 
P

Peter Bromberg [C# MVP]

You can set up Membership, Profiles, etc. with any type of project. You might
want to look at the QUICKSTARTS samples on the asp.net site for code samples.
Basically you determine the database in the connectionStrings web.config
section.
-- Peter
Site: www.eggheadcafe.com
UnBlog: petesbloggerama.blogspot.com
Metafinder: www.blogmetafinder.com
 
S

sloan

There are 2 things, and sometimes people use them interchangably.

There is the MembershipProvider. This is an abstract class, and there are
several concrete versions.

There is a built in , default MembershipProvider .. and its the
SqlMembershipProvider. It uses a sql server database of course.
You'll see tables like "asp_*" for this particuliar concrete version.

People have written other concrete versions. Heck, there's one for Access
somewhere.
If you don't have Sql Server, then google "MembershipProvider" "MyRDBMS"
(<<like Oracle). Somewhere, somebody has probably written a port over.

Then, for ultimate flexibility, you can derive your own. As in:
MyMembershipProvider : MembershipProvider
This is useful for when you already have a an existing db with usernames and
credentials.

the WSAT is ...something to avoid. It writes to the config file, only works
locally, and is more of a hobbyist answer for security.

MSDN has code you can get that gives you basic user management, you can
basically copy and paste the code into /Admin/RolesManage.aspx (for example)
pages.
(this is one solution).


The MembershipProvider and RoleProvider are based on ROLES, and not RIGHTS.
I find myself cursing at MS for this one sometimes.
For basic stuff, having roles like "admin", "normaluser", "guest" are ok,
but for a enterprise application I think rights, with configurable roles
(that contain those rights) would be a better solution.
But hey, MS makes alot more money than I do.
But I digress.

Here are some google searches that will help

MembershipProvider custom
MembershipProvider "Sql Server 2000"
(the above one is good even if you have another version of sql server,
it'll show you how to setup a asp_net database on any server)

MembershipProvider Access
(again, a good learning tool, even if you don't use Access)


Because MembershipProvider (and RoleProvider) are abstract, the backend
implementation can be different....but the code is all the same.
This is called the Provider Model ... or maybe in more OO terms, the Factory
Pattern.


Again, SqlMembershipProvider is the "out of the box" concrete version of
MembershipProvider ... that alot of people use.. but sometimes they will
refer to the concrete version AS the MembershipProvider, thus causing some/a
little bit of confusion.

...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top