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
I’m guessing from your use of
iteminstead 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:…then after the loop (if there is one) you put in a form and some wire-up JavaScript, like this:
To populate your action’s
isReferenceTrackingparameter you could add another hidden field and have that value as a data- attribute on each link.