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 6039369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:21:30+00:00 2026-05-23T06:21:30+00:00

When a user clicks on a link on my page, I want to be

  • 0

When a user clicks on a link on my page, I want to be able to record that link click then send the user off to that link in another window.

Given the following ActionLink:

@Html.ActionLink(Model.dsResults.Tables[0].Rows[i]["title"].ToString(), "LinkClick", new { itemListID = @Model.dsResults.Tables[0].Rows[i]["ItemListID"] })

The LinkClick ActionResult will be called with the ItemListID past to it. However, I don’t want to go back through my model/db to get the link. Can I pass a DataRow type and get the cell containing the link and other details, and secondly, once I have saved the link click, how do I redirect the user, in a new window, to that link?

Are there Razor HTML helpers for this kind of thing?

Thanks.

UPDATE

Seems that I’ve forgotten some of the basics… while the discussion with Malcolm regarding using caching holds some value, how about the following:

In the past, what I would do is link to an internal page which would open _blank, take in the ID, do the DB call to save, then redirect the user in that window to the appropriate URL.

I think this clarifies the issue a lot.

  • 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-23T06:21:30+00:00Added an answer on May 23, 2026 at 6:21 am

    There is no such helper available. I couldn’t 100% follow how you want this scenario to work, but the idea is that you should use jQuery to attach to the click event, call some tracking url via .ajax, and then return so the original link click is processed.

    
    //(this looks somewhat ugly - the point of this is the id parameter at the end to set the link's id)
    @Html.ActionLink(Model.dsResults.Tables[0].Rows[i]["title"].ToString(), "LinkClick", new { itemListID = @Model.dsResults.Tables[0].Rows[i]["ItemListID"], id="sweetLink" })
    
    

    Then your javascript block somewhere after the link:

    
    
    $('#sweetLink').click(function() {
      .ajax( your call here to record the click - ); //use $(this).whatever to access your link properties
       return true;
    });
    
    

    When the call returns the original link url will be processed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the use case: A user clicks on a link that opens a window
When a user click a link, it would redirect them to a page, something
I have the following script that runs when a user clicks a link that
I want to be able to take the user to the requested page after
So I want my users to be able to click a link in a
I want to be able to click on a link lower down my PHP
Use case: user clicks the link on a webpage - boom! load of files
In a fictitious web application ... The user clicks a link The server starts
My app should render html, to answer when a user clicks ajax-link. My controller:
When the user clicks on a link to generate report I make an AJAX

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.