473,395 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Prevent user from accessing any page directly without Login ?

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
4 6631
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: | last post by:
Please help. After a number of wrong turns and experiments I need advice on login management system to secure our web pages without inconveniencing our visitors or our internal staff. What I...
8
by: Smartin | last post by:
I have a form in Access97 which facilitates a query against a production Access database. Users will enter some search terms and see a datasheet view of the results in a subform. The prod table is...
2
by: swbaz | last post by:
What is an effect way to prevent users from viewing a webpage directly by typing in its URL? For example: If a default page is set up as a login screen with user name and password. The user...
18
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site...
6
by: Bhavini | last post by:
Hi All, I have to prevent multiple logins for the same user accessing at same time. i.e. if xyz user is active, no other login should be allowed for the same user ID. I thought of saving...
3
by: Phil | last post by:
Jerry posed some good ideas, a while back, on website a security issue that comes up often. Gary Jones was asking how to keep users from directly accessing php pages, out of sequence. Jerry...
2
by: =?ISO-8859-1?B?UOVsIEEu?= | last post by:
Have a "standard" asp.net web solution which uses the standard asp.net authentication and authorization methods (forms authentication). Some users have raised concern that even if you logout...
4
by: Brett | last post by:
I have an ASP.NET 2.0 application that uses Forms Authentication. The startup page contains just a login control, and the site works well on an IIS 6 web server. I am now setting the site up on...
12
by: tvnaidu | last post by:
I have Two kinds of web pagess, one is for control page for only admin login, another one is to view status for user login. initially both html files can view with 192.168.0.10/control.htm and other...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.