Solved

Hyperlink emulate Back Button

Posted on 2006-07-11
2
429 Views
Last Modified: 2010-05-18
Hi, I am very new to ASP so apologies if this is very basic but any help to solve my problem would be very much appreciated.

I have a hyperlink that I want to act like the IE Back button, simply to go back one page.

Looking through Experts Exchange I think I need to use the following code

<a href="javascript:history.go(-1)"> back</a>

however, as I am programming in VB.Net I am unsure of where to put this in the ASP Code.

My hyperlink is currently in a table and the associated ASP code at the moment is

<tr>
        <td style="width: 100px">
            <asp:HyperLink ID="HyperLink1" runat="server" ForeColor="Red"
                Style="left: 8px; position: relative; top: 0px" Visible="False" Width="627px" >No Forthcoming Appointments Found</asp:HyperLink></td>
               
 </tr>
   
Can someone please help me by showing me how to make this hyperlink act like the Back button.

Thanks
...Steve
0
Comment
Question by:swtiley
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
Comment Utility
Hi swtiley,

You have two choices, you can either replace the asp:Hyperlink with a non server-control (<a href="....">Text</a>) or assign an onclick event programatically in page_load:

HyperLink1.Attributes.Add("OnClick","javascript:history.go(-1);")

Tim Cottee
0
 
LVL 1

Author Comment

by:swtiley
Comment Utility
Thanks Tim, epecially for the quick response.

I took the pageload option, and works fine.

Cheers
...Steve
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now