2

I have a menu containing various links to specific pages in my app. One of them has just started exhibiting very strange behaviour. Heres the markup

<li>
    <a href="@Url.Action("Index", "Contract",
        new { id = Model.ContractId, orgId = Model.OrgId })">
        <i class="fa fa-briefcase"></i>&nbsp;Contract Details
    </a>
</li>

The controller action method signature:

public async Task<ActionResult> Index(int id, int orgId)

Whenever I click on the link I get this error:

[ArgumentException: Value cannot be null or empty.Parameter name: name] System.Web.Mvc.ActionNameAttribute..ctor(String name) +99

The action exists, the controller exists, the parameters being passed have values, yet I get this error. I've used exactly the same method on various other links in the same page, just to different controllers and they all work fine, it's just this one. I can't see what the problem is. Anyone got any suggestions?

juunas
  • 54,244
  • 13
  • 113
  • 149
proteus
  • 545
  • 2
  • 12
  • 36
  • 4
    You have `[ActionName]` attribute somewhere (in said action or somewhere else in the controller) with an invalid `name` argument – haim770 Jun 26 '17 at 08:14

0 Answers0