javascript "back" image within ASP.NET application

I love asp.net, but it's the simple things that can be really difficult.  Here's my latest challenge.  I have an image (btnBack) that I want the user to be able to click and (you guessed it) go back.  I set it up first as an image button and passed the js onclick information to it both via code-behind with attribute.add and with the OnClientClick function.  In both cases, the page refreshed, but did not go back (NOTE: i tried both window.history.back and window.history.go(-1)).  

i then moved to using a hyperlink around the image with href="#' and an onclick function, but same result.  to further test my onclick function, i wrote it up separately as "goBack()" and added a first step of an alert("function triggered") so that it looked like the function below:

    function goBack() {
        alert("function triggered");
        window.history.back;
    }

at this point the function worked, BUT if i remove the alert (and hence the user interaction), it does not work.  in case it was a timing issue, i tried using a settimeout, but this did not help either.  what a pain in the ass, i just want to access the browser's back button behavior without making a call to the server.  

thanks in advance for your assistance.

kmt
LVL 4
kmt333Asked:
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.

baretreeCommented:
have you tried using the parentheses "()" in your code like

onclick="window.history.back();return;"

cause that works, at least for me

remember an error like that in javascript won't throw anything, will just stop the script execution
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
kmt333Author Commented:
bless you!  what i actually needed was to specify the "return".
kmt
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.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.