[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Hyperlink emulate Back Button

Posted on 2006-07-11
2
Medium Priority
?
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 2000 total points
ID: 17080373
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
ID: 17080407
Thanks Tim, epecially for the quick response.

I took the pageload option, and works fine.

Cheers
...Steve
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses

649 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