<INPUT type='button' onclick='history.go(-1)' value='<< Back' id='button'1 name='button'1>"
Main Topics
Browse All TopicsHi Everyone,
I tried using the below javascripts on my vb code behind for both the page_load and btCancel_Click event, it does not take me back to the previous page.
btCancel.Attributes.Add("o
OR
btCancel.Attributes.Add("o
What else can I try?????
The Cancel button is part of a form to gather user input data and submit them if users desired to but they want to cancel out this page, they can click on the cancel button to go back to the previous page where they come from.
Thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I was using the HTML button before, but since I need to reference this control in the codebehind it gave me error with regards to Object not instantiated. So I tried to go back using the below HTML button, it works. I don't know why it didn't worked before. I'll need to do some more testing.
<input id="btCancel" onclick="Javascript:histor
Anyway, thanks so much!
ASP.NET buttons (in the System.Web.UI.Webcontrols family) are ALL automatically SUBMIT buttons. That means when you click them, they submit the page. This action takes precedence over any onclick events that you code. However, you can cancel the submit by returning a value of false from YOUR onclick code.
So your original idea would work, but you need to add a return false.
btCancel.Attributes.Add("o
Business Accounts
Answer for Membership
by: praneethaPosted on 2004-12-14 at 08:32:21ID: 12821058
<A onmouseover="ibtnCancel.sr c='Buttons /canceldow n.png';" onmouseout="ibtnCancel.src ='Buttons/ cancelup.p ng';" ack()"><IM G src="buttons\cancelup.png" border="0" name="ibtnCancel"></A>
href="javascript:history.b
instead of asp.net button you can just have html button or <a link as shown above...