problem on back button

B

baroque Chou

The purpose is simple, I want to display a list of photo thumbnails,
and each has it's own access level defined, only authorized internet
user can view the full size photo.
in order to achieve this, I write line of code in the codefile to judge
whether the current user has right to view further, and if not, say,
RegisterStartupScript("startupScript", "<script
language=JavaScript>alert('you don't have right to
view!');</script>");
This works fine when the user click the unauthorized photo with the
alert jumped, while the user move on to other photos that is
accessable, the page turn to the full size photo, when he or she try to
click the back button on the browers, the alert jumped again which is
not what I want.
it may be caused by the startup script, is there any solution as to
achieve this purpose ?
 
G

Guest

The best thing would be add the script to the click event of the image if it
is not accessable. This way the script ONLY fires if the image is clicked.

You can add the script by doing something like:

myImage.Attributes.Add("click","alert('You are not authorized to view this
image.')");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top