How Do I: Secure my Site using Membership and Roles?

Learn how to secure a web site using the new Membership and Roles features of ASP.NET 2.0. Topics include user registration, password recovery, and restricting access to content with roles.

Duration: 17 minutes, 43 seconds

Date: 9 January 2006

Watch the video   |   Download the video   |   Get VB code  or  C# code

Video downloads: WMV | Zune | iPod | PSP | MPEG-4 | 3GP

Audio downloads: AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Comments : 24

Leave a Comment

lesonfu : On March 19, 2008 11:52 PM said:

ASP.NET is so great!!

m3loma : On March 25, 2008 11:02 AM said:

yeah

ramesh.kumarv82 : On March 26, 2008 9:42 AM said:

This video Secure my Site using Membership is really excellent .

sury77 : On March 26, 2008 12:40 PM said:

everything works great on local computer when i copy files

to the      

       surywebdesi.web701.discountasp.net

and try to run geting Server Error in '/' Application. Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty

                                     need help thx sury

wisecarver : On March 28, 2008 12:01 PM said:

I'm creating a video for you Sury.

A lot of people are having the same trouble...

(Local Express DB to remote hosted SQL Server DB.)

The video will cover how to handle this problem.

 Salute,

   Mark

boqo : On April 11, 2008 6:42 AM said:

i have asp.net page containing data from database. i can add products to cart. To add to cart, i change the bit from 0 to 1 and then show all products whose bit is 1 on add_to_cart page. but this situation is true for only one user. when another users login then that cart bit is already 1 for that user.

i want that for all users must access the original database i.e cart field must 0 not 1.

help please

BrianMize : On April 22, 2008 11:13 AM said:

Everything works as demonstrated in the video, however, if I login under admin and view a profile secure page (e.g. manage users, etc.) and then login under the user account (in this case "mike"), then I'm not able to see it as excpected, however, if I hit backspace a few times, I can because then I'm logged in as admin.

How can I keep that from happening, I think it has something to do with having the page expire, but how is that done in asp.net?

Also, is it a good idea or OK to hide the login box by putting it inside the login view so that if you are logged in you won't see it?

Thanks

zarak786 : On May 05, 2008 2:25 AM said:

Please help help help

When i run from visual studio it runs smoothly but when i publish to IIS or to remote server it gives me a user/password error

Your login attempt was not successful. Please try again

SchultzIdeas : On May 05, 2008 12:36 PM said:

Zarak,

I am by means no expert but I have the answer to your problem after many frustrating hours myself. After you publish your site.

1. Be sure and manually copy your ASP_DATA directory to your website.

2. Edit the permissions on your ASP_DATA directory at your IIS Site. Make sure IIS/Users have modify persmissions.

Hope this fixes it for you.

fahadm : On May 08, 2008 9:54 AM said:

thank you

waqarlaghari : On May 12, 2008 6:35 AM said:

thank you asp.net to provide a best resoucre for students to understand new technology with videos... again thanks

aftab : On May 24, 2008 11:50 AM said:

I really like this guy.

He knows what he is saying. Training at his best!

timwp : On June 11, 2008 2:00 PM said:

is there a post or tutorial that can point me in the direction of implementing this type of security on a webserver which doesn't have VWD installed. can i just append the data file created on my testing server to the database on my production server?

thaqi498 : On June 19, 2008 4:39 AM said:

this video is ok........

but i want another video for the same purpose(roles and membership),instead of using asp.net websiteconfiguration,we have to write code fully

shweko : On June 23, 2008 9:50 AM said:

nice video.

Can you please do some demo using databases other than SQL server db?

Thanks

shwe

imAdeel : On June 26, 2008 10:14 AM said:

hi Guys,

I followed the instruction and everything worked on my local server, I want to know , how to upload or make it work on my hosting server, what needs to be there inorder to make it work on internet?

I will appreciate your reply.

Thanks,

Adeel

tezelcelebi : On July 03, 2008 9:56 AM said:

hi,nice video.

on createuser wizard, you are taking current user's name that is logged on, not the newly created user. therefore

OnDeactivate method it should be like this:

Roles.AddUserToRole(CreateUserWizard1.UserName, ListBox1.SelectedValue);

regards,

tezel

suesargis : On July 03, 2008 6:15 PM said:

great info but I got lost in the part adding code to select user roles.

Where is this written so I can copy it?

thanks

ruce : On July 30, 2008 9:10 PM said:

What happens when you don't see the ASPNETDB.MDF folder inside App_Data in my site project?

I have created roles/memberships security etc. in WAT. but can't see any folder called ASPNETDB.MDF.

cv_vikram : On August 06, 2008 1:23 PM said:

Cooooool.....

kemik25 : On August 11, 2008 3:25 PM said:

Usefull Easy to Understad. Do you have any video format learning material.

vision1685 : On August 11, 2008 7:38 PM said:

please i'm new into the whole programming stuff but i really do love to be a programmer, maybe because i love thinking.

i will like somebody to assist me with the code on how to connect a database to a form and create report......

pavanbh143 : On August 26, 2008 7:09 AM said:

hello all,

 i am new to this programming field but i understood very easily about .net because of dragging and dropping  controls make it easy and this supports type free, not only that in other programming languages like java and all we need to develop a control on our own but here all controls are listed and ready to use this made my job very easy thanx to microsoft corporation and those helping me on online

 thanx

pavan.......

pgcrooks : On August 26, 2008 11:02 AM said:

Hey all, bit of a problem here... When I click on the ASP.NET Configuration button and then Security, I keep getting an error message saying the database connection could not be made. Any ideas how to get around this? I thought the config app biult the db itself :S

Thanks,

Paul

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Featured Product

ComponentArt's New AJAX Approach

Page view counter
Microsoft Communities