Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

using membership providers for a web application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Fish - 06 Dec 2007 11:09 GMT
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
Peter Bromberg [C# MVP] - 06 Dec 2007 12:26 GMT
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

> Hi,
>
[quoted text clipped - 14 lines]
>
> Andy
Kevin Spencer - 06 Dec 2007 12:28 GMT
See the following MSDN articles:

http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx
http://msdn2.microsoft.com/en-us/library/44w5aswa.aspx
http://msdn2.microsoft.com/en-us/library/6tc47t75.aspx

The Web Site Administration Tool persists settings in the web.config file.

Signature

HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

> Hi,
>
[quoted text clipped - 14 lines]
>
> Andy
sloan - 06 Dec 2007 15:24 GMT
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.

..

> Hi,
>
[quoted text clipped - 14 lines]
>
> Andy

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.