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

  • SEARCH
  • Home
  • 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 9160999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:52:09+00:00 2026-06-17T13:52:09+00:00

I have a fairly simple scenario I have an action method in my controller

  • 0

I have a fairly simple scenario

I have an action method in my controller with syntax like that

[HttpPost]
    public ActionResult Consignment(string txtConsNo, string isReferenceTracking)
    {}

Not in a page I need to create an hyperlink in application which needs to access this action method. I am using HTML.ActionLink method to create hyperlink like this

        @Html.ActionLink((string)item.RDC_CONSNO, "Consignment", "Tracking", new { txtConsNo = (string)item.RDC_CONSNO, rdbConsNo = "" }, null)

But it creates the link like this

http://localhost:3412/Tracking/Consignment?txtConsNo=100245506

How should I go around this?

Thanks

  • 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-06-17T13:52:10+00:00Added an answer on June 17, 2026 at 1:52 pm

    I’m guessing from your use of item instead of a model that you’re rendering the links in a loop? In any case, I’d suggest adding a form and having the link post it; the link(s) would be like this:

    @Html.ActionLink(
        (string)item.RDC_CONSNO,
        "Consignment", 
        "Tracking",
        new { @class = "consignmentLink" });
    

    …then after the loop (if there is one) you put in a form and some wire-up JavaScript, like this:

    @using (Html.BeginForm("Consignment", "Tracking"))
    {
        @:<input type="hidden" id="txtConsNo" name="txtConsNo" />
    }
    
    $("a.consignmentLink").click(function(e) {
        e.preventDefault();
        var $consignmentNumberInput = $("#txtConsNo");
        $consignmentNumberInput.val($(this).text());
        $consignmentNumberInput[0].form.submit();
    });
    

    To populate your action’s isReferenceTracking parameter you could add another hidden field and have that value as a data- attribute on each link.

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

Sidebar

Related Questions

I have what seems to be a fairly simple scenario that I am trying
I have a fairly simple web2py form with a few validators like, IS_FLOAT_IN_RANGE(...) on
I have a fairly simple python loop that calls a few functions, and writes
I have a fairly simple math operation I'd like to perform on a array.
I have a fairly simple class that I want to save to SQL Server
I have a fairly simple spreadsheet application with some VBA code that performs simple
I have a fairly simple HTML page with a link on it that calls
I have a scenario whereby I am needing to display some fairly simple data
I have a fairly simple bash script that does some grep to find all
I have a fairly simple user control that represents a basic login control. So

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.