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