Page view counter

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 : 40

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

yamu : On September 07, 2008 3:55 AM said:

thanks for nicer video, but I have problem, I followed your instruction and create 3 roles 1.Administrator 2.Power User 3.User, in Administrator I have full access, when I create new user (Mikki) and set role as Administrator, and login with Mikki I can log but Admin folder could not appear, when I check it in Website Administrator Tool, User Mikki is created but no one role is checked, so how I can solve this problem

I am looking help, help will be appriable

Regards

yamu

BrightChen : On September 23, 2008 2:57 PM said:

thank you for your work

mpark : On October 01, 2008 11:31 AM said:

Please can someone tell me how i can use an internal sql database with this application?

subhamajumdar : On October 11, 2008 1:59 AM said:

Please can someone tell me how i can run my asp.net project online.

vadim.vasilenko : On October 14, 2008 12:19 PM said:

Mark, great thanks for this video!

Archichueng : On October 17, 2008 9:44 PM said:

Perfect!i love it.

Archichueng : On October 17, 2008 10:20 PM said:

hi all, who can tell me where can I get the file "masterpages.zip" when creating a new project.

thanks

Phay : On October 19, 2008 7:53 PM said:

Hi all, This is great VDO but i still have problem with Password Recovry the error msg occors like this "The remote name could not be resolved: 'exchange1' ".

Anyone can tell me weither we can submit from Local machine or not? my PC is cannected to Internet.

Thank you!

AnjuSri : On October 21, 2008 6:21 AM said:

Hi,

Thanks for a wonderful video. Its too good.

But i couldn't get from where i can find the "masterpages.zip". I searched it everywhere but was not successful.

aeg@online.no : On October 25, 2008 7:46 AM said:

I have followed your video series and now I want to add a new database to this webSite(Secure my Site using Membership and Roles) and tryed programming it through using the video "Create Data-Driven Web Sites", but where onely a empty DropdownList and no GridView.

I did the same in another simple project same as "Create Data-Driven Web Sites" and it worked there.

Some idea

pathak.sarvesh86 : On October 27, 2008 6:01 AM said:

hello! friends i am the new member!

djibril_chimere_DIAW : On October 28, 2008 5:57 AM said:

Thanks! Jërëjëf!

bbernal : On November 04, 2008 8:08 PM said:

I am also looking for the masterpages.zip file

any one knows?

AnjuSri : On November 05, 2008 3:22 AM said:

i couldn't get masterpages.zip template..

Can anyone help ?

Sumon Rahman : On November 17, 2008 12:36 PM said:

Hi all, I'm from Bangladesh. Here ASP.net is very popular for building web-aps. I've got a lot of help from the videos. But if all the videos is in C# then it will be so fruitful for me.

AnjuSri : On November 18, 2008 8:20 AM said:

Hi,

I am facing problem as the mails are not getting delivered and getting stuck in C:\Inetpub\mailroot\Queue folder.

Can anyone help ???

How can i enable delivery of the emails???????????????

Leave a Comment

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

Microsoft Communities