Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7529687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:43:31+00:00 2026-05-30T04:43:31+00:00

I am going to have a listview with links that get binded from the

  • 0

I am going to have a listview with links that get binded from the database. I am wanting to track when that link gets clicked on. This will be so i can tell what links are clicked on the most. I tried doing this with a linkbutton, but ran into the problem where the color does not change when it is visited. I doubt i can do it with a hyperlink since the hyperlink does not hit the server. Any suggestions on how to do this.

This is how i did the linkbuttons

<asp:ListView ID="lstvTopTen" runat="server">
    <ItemTemplate>

        <tr>
            <td width="100%">
                <asp:LinkButton ID="lbtnUrlLink" runat="server" Text='<%# Bind("NewsTitle") %>' 
                    CommandArgument='<%# Bind("NewsUrl") %>' onclick="lbtnUrlLink_Click" 
                    OnDataBinding="lbtnUrlLink_DataBinding" CssClass="newslink" />
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("NewsDescriptionDisplay") %>' />
            </td>
        </tr>

    </ItemTemplate>
</asp:ListView>

here is my css

    .newslink 
{
    display:block;
    margin: 15px 0 0 0;
    text-decoration: none;
    font-size:1.2em;
    line-height: 1.8em;
    border-bottom:1px solid #CCC;
}

.newslink:visited
{
    color: Red;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:43:32+00:00Added an answer on May 30, 2026 at 4:43 am

    So this is how i ended up doing it.

    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Bind("NewsUrl") %>' Target="_blank"
                        onclick="countClick(this.href);" CssClass="newslink" Text='<%# Bind("NewsTitle") %>' />
    
    
    
    <script type="text/javascript" language="javascript">
    
        function countClick(name) {
    
            PageMethods.CountClick(name);
    
        }
    
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a Listview with dynamics rows that read them from database. now i
What I have going on is a listview inside of my windows form. How
I have a UITableView cell that is going to have a variable size depending
I am going to have a daemon that will run on a FreeBSD server,
I'm going to have a single site that needs to be themed a number
My site is going to have a credit system that basically works a lot
I'm sure I'm going to have to write supporting javascript code to do this.
I have a question that I'm ashamed to ask, but I'm going to have
This is going to be a long post. I would like to have suggestions
I have a ListView on a page that displays a list of widgets. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.