How to redirect to the same page from where the update was requested?

I have this button on several pages of my web site:

<form method="POST" action="AccessLevel.asp"><input type="hidden" name="ID" value="<%=ID%>"><input type="hidden" name="AccessLevel" value="2" /><input type="Submit" value="Submit" /></form>

This is my AccessLevel.asp:


<%
myId = Request.form("ID")

myAccessLevel = request.Form("AccessLevel")

StrSQL = "Update AdminData SET AccessLevel= '" & myAccessLevel & "' Where ID in ("&myId&")"

Conn.Execute StrSQL

'Redirect to the UPDATED page
Response.Redirect "index.asp"
%>


What I would like is redirect the users to the same page from where the update is requested, i.e. to where the button was clicked, instead of index.asp

I would appreciat your help.
romsomIT DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
Why not just remove the redirect and you should still be on the updated page.
0
GaryCommented:
Response.Redirect to the referrer?
0
romsomIT DeveloperAuthor Commented:
Gary - Yes, response.redirect to the referrer.

Number1 - I didn't know how to place the code on the same page
0
GaryCommented:
So just change your redirect
Response.Redirect  (Request.ServerVariables ("HTTP_REFERER"))
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
romsomIT DeveloperAuthor Commented:
Thank you very much; I've learned something new.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.