Solved

Capturing Clicked Links from my ASP page

Posted on 2013-01-09
1
213 Views
Last Modified: 2013-01-10
Hi,
I am working on this ASP application and I would like to find a way to capture a clicked link from a page. Let say, I have page A and page B, somebody clicks on a link on page A that directs them to page B. However, I would like to be able to display in a label on page B the link of Page A where the click originated from.

Illustration:

http://abc.com
http://xyz.com

when
0
Comment
Question by:snazaire
1 Comment
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 500 total points
ID: 38759680
Try this,
Aspx:
<asp:Label ID="backurl"  runat="server" >Back</asp:Label>

Open in new window


    protected void Page_Load(object sender, EventArgs e)
    {

        backurl.Text = "";
        if (Request.UrlReferrer != null)
        {
            
            backurl.Text = "<a href='" + Request.UrlReferrer.ToString() + "'>" + Request.UrlReferrer.ToString() + "</a>";
            
        }
    }

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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