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 / September 2007

Tip: Looking for answers? Try searching our database.

Prevent user from accessing any page directly without Login ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luqman - 16 Sep 2007 20:29 GMT
How can I Prevent user from accessing any page directly without Login ?

User should not be able to by pass the Login screen by typing the Url of any
page directly.

I am using ASP.Net 2.0 with Visual Studio 2005.

Best Regards,

Luqman
David C. Barber - 16 Sep 2007 20:46 GMT
One way would be to place a logged-in valid value in your Session object for
this user.  Each page checks the Session object for this value, and
redirects to an error page if it's not set correctly.  Each user has a
unique Session object in ASP .NET.

> How can I Prevent user from accessing any page directly without Login ?
>
[quoted text clipped - 6 lines]
>
> Luqman
Andreas Kraus - 16 Sep 2007 21:06 GMT
Enable Roles and then for example in web.config

<authorization>
<allow roles="Customer, Administrator, Inactive"/>
<deny users="*"/>
</authorization>

hth

Signature

More on ASP.NET and Silverlight on my blog: http://www.andreas-kraus.net/blog

> How can I Prevent user from accessing any page directly without Login ?
>
[quoted text clipped - 6 lines]
>
> Luqman
Peter Bromberg [C# MVP] - 17 Sep 2007 01:08 GMT
Not to sound like a corrupt MP3, but you can get all this information with
example code by following the QUICKSTART samples. These install with either
Visual Studio, or the .NET Framework., and you can also view online at the
asp.net web site.
Peter
Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> How can I Prevent user from accessing any page directly without Login ?
>
[quoted text clipped - 6 lines]
>
> Luqman
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 17 Sep 2007 16:47 GMT
The typical solution is Forms Authentication, which is built into ASP.NET.
Here's more info:
http://www.dotnetbips.com/articles/2fdd29a0-9313-4439-9e24-4e2a9f2cb897.aspx
http://www.dotnetbips.com/articles/8de08fdb-1150-47f5-9831-133dd25b308b.aspx

Combine that with the new login controls of ASP.NET 2.0 and you've got
pretty much everything you need with virtually no code required.  Here's
more info on that:
http://SteveOrr.net/articles/SecureYourSite.aspx

Signature

I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

> How can I Prevent user from accessing any page directly without Login ?
>
[quoted text clipped - 6 lines]
>
> Luqman

Rate this thread:







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.