Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 11th, 2009, 02:18 AM
Authorized User
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
Question User Cannot go directly to a specific page

Hi,

I have 3 pages(Page1, Page2, Page3) in my Application,

Now the problem is that I don't want the User to go directly to Page 2 or Page 3. User should be redirected to Page 1, if they do so.

How this can be achieved?


“There has to be evil so that good can prove its purity above it.”
- Gautam Buddha

Thanx
- Anup
 
Old December 12th, 2009, 01:02 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmm. I guess the easiest way would be to use a session value or a cookie so, for example, the user comes to Page 1 then they click on a button to go to page two on the button click on page one set some sort of value in a session variable or cookie then redirect the user to page 2. On Page_Load on page 2 do a test to see if this value exists; if it does you know the user came from Page 1 otherwise redirect them back to page 1. The same logic would work going from page 2 to page 3.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
The Following User Says Thank You to dparsons For This Useful Post:
anup.maverick (December 12th, 2009)
 
Old December 12th, 2009, 05:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

u can privent user by typing address in address bar as
Code:
if (Request.ServerVariables["HTTP_REFERER"] == null)
{
// address had been changed by user
}
u may use functions as below to contol ur user, check them more in MSDN

Code:
Page.Request.UrlReferrer
Page.Request.PhysicalApplicationPath


HTH
__________________
Always,
Hovik Melkomian.
The Following User Says Thank You to melvik For This Useful Post:
anup.maverick (December 14th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create user in a specific role arnab-jit BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 June 23rd, 2009 09:59 AM
How do after i login it will display specific user PHP FAQs 0 July 20th, 2006 08:06 PM
show data for a specific user momo BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 July 17th, 2006 09:08 PM
View recordset for the specific user mikersantiago Classic ASP Basics 4 October 20th, 2004 10:19 AM
Getting to Specific Page everest Classic ASP Databases 3 March 28th, 2004 01:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.