@james19862012
As the title hopefully made clear...I want to restrict the access of a user data control so anonymous users (ones who havent registered with my site) can't access its contents.
What platform are you using? Are you are using vbulletin or something else. The question you ask doesn't really make sense because you never explain why you need this?
LastMitch
Industrious Poster
4,118 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45
Context.Identity.User.Name
This is generally used for intranet web sites where you enable Windows authentication on the website in IIS. This allows you to grab the user identity (user credentials used when loggin on to the computer).
If this is a public facing website, this isnt going to be useful for you. You can build a simple login component and store the user name in a session variable and also the user's role.
You may want to check out the security modules on the asp.net website. There are quite a bit of built in classes you can leverage and integrate into your application. Makes things a bit easier, or more difficult if you are not an avid asp.net developer.
http://www.asp.net/web-forms/tutorials/security
JorgeM
Senior Poster
3,997 posts since Dec 2011
Reputation Points: 294
Solved Threads: 543
Skill Endorsements: 115
Did you follow up on the link I provided?
JorgeM
Senior Poster
3,997 posts since Dec 2011
Reputation Points: 294
Solved Threads: 543
Skill Endorsements: 115
@james19862012
I'm sorry...I'm building the site in Visual Studio 2010 using VB.
OK wow I'm no familiar with VB. I think the link that JorgeM provided is a good start.
LastMitch
Industrious Poster
4,118 posts since Mar 2012
Reputation Points: 132
Solved Threads: 334
Skill Endorsements: 45