By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,617 Members | 1,792 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,617 IT Pros & Developers. It's quick & easy.

Prevent user from accessing any page directly without Login ?

P: n/a
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


Sep 16 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.

"Luqman" <pe*******@cyber.net.pkwrote in message
news:ew***************@TK2MSFTNGP04.phx.gbl...
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


Sep 16 '07 #2

P: n/a
Enable Roles and then for example in web.config

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

hth

--
More on ASP.NET and Silverlight on my blog: http://www.andreas-kraus.net/blog
"Luqman" wrote:
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


Sep 16 '07 #3

P: n/a
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
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Luqman" wrote:
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


Sep 17 '07 #4

P: n/a
The typical solution is Forms Authentication, which is built into ASP.NET.
Here's more info:
http://www.dotnetbips.com/articles/2...a9f2cb897.aspx
http://www.dotnetbips.com/articles/8...dd25b308b.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

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Luqman" <pe*******@cyber.net.pkwrote in message
news:ew***************@TK2MSFTNGP04.phx.gbl...
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

Sep 17 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.