473,386 Members | 1,819 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,386 software developers and data experts.

about link problem

Dear All,

i have a page called "index.aspx", at http://localhost/test/index.aspx
in the index.aspx, there is a button, while the user click this button, the
page will be redirect to
"modify.aspx", at http://localhost/test/modify.aspx by using
server.transfer("modify.aspx")

there is my question, how can i ensure that that all the users access the
modify.aspx is via the index.aspx?

i don't want the user to direct type http://localhost/test/modify.aspx in
the URL to go to modify.aspx

how can i do it?

Thank you

Regards,
Angus
Nov 18 '05 #1
2 927
Angus,

The easiest way that I can think of is to pass a variable in the page's
context object. The context object is passed to the next page when you use
server.transfer.

So on your index.aspx page you set the context item like this:

Context.Items.Add("PermissionGranted", True)

Then on your modify.aspx page's load event check that the context item
exists. If it doesn't the user didn't arrive from index.aspx so redirect
back there.

If Not Page.IsPostBack Then
If Not Context.Items.Contains("PermissionGranted") Then
Response.Redirect("index.aspx")
End If
End If

You could of course actually get the context items value, Dim
PermissionGranted As Boolean =
CType(Context.Items.Item("PermissionGranted"), Boolean), but that's
pointless since if it exists it has to be true since you added it...
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"angus" <an***@angus.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Dear All,

i have a page called "index.aspx", at http://localhost/test/index.aspx
in the index.aspx, there is a button, while the user click this button, the page will be redirect to
"modify.aspx", at http://localhost/test/modify.aspx by using
server.transfer("modify.aspx")

there is my question, how can i ensure that that all the users access the
modify.aspx is via the index.aspx?

i don't want the user to direct type http://localhost/test/modify.aspx in
the URL to go to modify.aspx

how can i do it?

Thank you

Regards,
Angus

Nov 18 '05 #2
Dear Gengo,

it works. Thank you

"S. Justin Gengo" <sjgengo@aboutfortunate[no-spam].com> wrote in message
news:10*************@corp.supernews.com...
Angus,

The easiest way that I can think of is to pass a variable in the page's
context object. The context object is passed to the next page when you use
server.transfer.

So on your index.aspx page you set the context item like this:

Context.Items.Add("PermissionGranted", True)

Then on your modify.aspx page's load event check that the context item
exists. If it doesn't the user didn't arrive from index.aspx so redirect
back there.

If Not Page.IsPostBack Then
If Not Context.Items.Contains("PermissionGranted") Then
Response.Redirect("index.aspx")
End If
End If

You could of course actually get the context items value, Dim
PermissionGranted As Boolean =
CType(Context.Items.Item("PermissionGranted"), Boolean), but that's
pointless since if it exists it has to be true since you added it...
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"angus" <an***@angus.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Dear All,

i have a page called "index.aspx", at http://localhost/test/index.aspx
in the index.aspx, there is a button, while the user click this button,

the
page will be redirect to
"modify.aspx", at http://localhost/test/modify.aspx by using
server.transfer("modify.aspx")

there is my question, how can i ensure that that all the users access the modify.aspx is via the index.aspx?

i don't want the user to direct type http://localhost/test/modify.aspx in the URL to go to modify.aspx

how can i do it?

Thank you

Regards,
Angus


Nov 18 '05 #3

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

Similar topics

1
by: Ben | last post by:
Hi all, I want to store unique data about my page visit. This is done using cookie value. In my database, the page name and cookie value(ip address) are both primary keys. This ensures unique...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
40
by: JohnnyCJohnny | last post by:
Is it pretty safe to say that almost all web surfers now use browsers that are Frames compatible? What are most people using these days? IE? Thanks
97
by: Cameron Laird | last post by:
QOTW: "Python makes it easy to implement algorithms." - casevh "Most of the discussion of immutables here seems to be caused by newcomers wanting to copy an idiom from another language which...
1
by: UJ | last post by:
I am doing development on a machine and everything was working fine. The name of the project was ECS to I made all my references as ~/ECS/... Worked great. Put it on the final server running...
2
by: TheRomance | last post by:
i have a problem about insert integer to link list. sorry it's too long but i try many times, many ways , it's still have an error function is fix . can't change anything about function. i...
4
by: Andreas Borutta | last post by:
Hi, what is the task with which I could not cope? There is a link with an inline-element (strong e.g.) inside. It has a higher font-size than the content of its parent. For the hover effect...
2
by: Joey | last post by:
I have written an app in C#/asp.net 2.0 that is a system built to handle a large number of scenarios. Part of that system involves allowing users to download large files. As part of my original...
3
by: Salad | last post by:
With the database window open I click on Help, then click on "About Microsoft Office Access". A dialog window is presented and there are 4 buttons at the bottom right of the form. One is...
4
by: Richard Harter | last post by:
I have a couple of questions about the following code fragment: struct list_info { void * first; void * last; }; struct pipe_data_list { void * data; struct agent_port_list * dest;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.