I have an existing ASP.NET web application that is for public use and any anonymous user can access it. I would like to implement mechanism for users to sign up. The first thought that crossed my mind is to use the ASP.NET membership API.
So, If I use the Membership API:
- Can I integrate it with an existing
SQL express database? I would rather
not have two separate databases - Can I choose not to have GUIDs for
User IDs? - Can I install only the tables needed
for Membership to work? I would not
want to have tables for say WebParts
as this website will never have
WebParts. - Anonymous users will still have
access to all the pages (I might
limit the features though). Can I do
this and can I somehow track
anonymous users? - Can I customize the create user
account control to not have security
question and answer?
Any useful video tutorials on membership api is really appreciated
1) Yes, you can integrate an existing database. See
here. This will create all the Membership tables and stored procedures required to use the API.2) You can use whatever ID you want. Usually, if it’s not a GUID, it’s an incrementing INT.
3) The tool in the link above installs the required tables. AFAIK, there are no tables for Web Parts in that installation, but that may need confirming.
4) You can allow anonymous users to access whatever areas you like. You can place restrictions via the
authorizationattribute in the web.config file. To track anonymous users,thisis quite a good article.5) You can customize the user account to however you like. If you want to remove the Security Question and Answer section, you can. Requires a bit of configuration, but there’s some tutorials over at
ASP.NETand4GuysFromRolla.You could use a custom provider instead as CodeToGlory mentioned. See what would suit you best. But, don’t forget to
make a backup of your database before starting either methods, just incase something goes wrong 🙂