473,320 Members | 2,088 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,320 software developers and data experts.

Possible to prevent direct navigation to a page?

Ben
Hello
I am in the final stages of developing my asp.net app and have a question.
The app im creating has two frames, one being a menu and the other showing
the detail.

I would like to prevent the user for typing in direct addresses without
using the application (ie server/appname/page.aspx?parameter=value). Is it
possible to prevent a user from attemping this? Can it be detected and then
rerouted to the default page (ie server/appname)?

Thanks in advance.
ben
May 25 '06 #1
3 3240
Ben,

The only thing that I can think of here is that you have to check the
referrer in the page. If they type it in directly, there will be no
referrer, and then you can block access.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:F7**********************************@microsof t.com...
Hello
I am in the final stages of developing my asp.net app and have a question.
The app im creating has two frames, one being a menu and the other showing
the detail.

I would like to prevent the user for typing in direct addresses without
using the application (ie server/appname/page.aspx?parameter=value). Is
it
possible to prevent a user from attemping this? Can it be detected and
then
rerouted to the default page (ie server/appname)?

Thanks in advance.
ben

May 25 '06 #2
Take a look at the Page.Request.UrlReferrer property which should give you
the address of the previous page. You should probably put this check in a
base class so that all classes inherit it and it is performed automatically.
--
Jeffrey Hornby
Hornby Consulting, Inc.

"Ben" wrote:
Hello
I am in the final stages of developing my asp.net app and have a question.
The app im creating has two frames, one being a menu and the other showing
the detail.

I would like to prevent the user for typing in direct addresses without
using the application (ie server/appname/page.aspx?parameter=value). Is it
possible to prevent a user from attemping this? Can it be detected and then
rerouted to the default page (ie server/appname)?

Thanks in advance.
ben

May 25 '06 #3
Ben
Thanks for the replies.

I cant seem to get this to work. All the properties of the UrlReferrer seem
to not exist regardless of how I try this. Maybe Ill keep looking.

The only problem i see, is that using the left frame (treeview), when a page
is opened, would there be a value for the urlreferrer? because its like that
page is opened and sent directly to a specific location.

Maybe I need to check during the page load that there is a menu frame open.
hmmm. Is that possible?

Thanks

"Nicholas Paldino [.NET/C# MVP]" wrote:
Ben,

The only thing that I can think of here is that you have to check the
referrer in the page. If they type it in directly, there will be no
referrer, and then you can block access.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:F7**********************************@microsof t.com...
Hello
I am in the final stages of developing my asp.net app and have a question.
The app im creating has two frames, one being a menu and the other showing
the detail.

I would like to prevent the user for typing in direct addresses without
using the application (ie server/appname/page.aspx?parameter=value). Is
it
possible to prevent a user from attemping this? Can it be detected and
then
rerouted to the default page (ie server/appname)?

Thanks in advance.
ben


May 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Brearley | last post by:
I have a counter (alright one I found on asp101.com) that checks for a session variable to prevent the counter from incrmenting if a user refreshes the page or returns to the page during the same...
1
by: douglas.gennetten | last post by:
I would like to present a page that would show a default image along with a button. The button would do a local file upload of sorts. I would replace the image with the locally selected file, then...
1
by: acrocker | last post by:
I would like to provide access to users who need to be taken directly to the relevant page without further navigation instructions. Unfortunately the page I want to access is built using a...
13
by: Alison Givens | last post by:
....... that nobody knows the answer. I can't imagine that I am the only one that uses parameters in CR. So, my question again: I have the following problem. (VB.NET 2003 with CR) I have a...
2
by: lanem | last post by:
How can I limit the possible months a user can navigate to in the calendar control? I only want users to be able to select dates from the current year and the previous year. Is that possible?
28
by: laredotornado | last post by:
Hi, Surprisingly, I can't get the drop down menus to work on PC IE 6. If you roll over "PRODUCTS", normally a drop down menu appears (on Safari and Firefox), but on PC IE, nada. ...
5
by: Bill Davidson | last post by:
All: Pardon the newbie question, but let's say I've got two pages in my website: Welcome.aspx NoNav.aspx I want users to be able to navigate to the welcome.aspx page (e.g....
2
by: Otis Mukinfus | last post by:
Sorry for the long title. How does one prevent a tab key press from causing the focus to leave a page and move to the navigation bar and tool bars in a browser? I've set the TabIndex on all of...
2
by: paintedjazz | last post by:
I realize that CSS is a presentation tool only but it does surprise me sometimes e.g. pure css dropdown menus. All I've ever seen is javascript to accomplish this but that doesn't seem to really...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.