-1

This is My Action link

@Html.ActionLink("Register", "Signup", "Account", routeValues: null, htmlAttributes: new { @class = "call-to-action", id = "registerLink" })</li>

And this Is My Action

[ActionName("Signup")]
public ActionResult Register() 
{
  return view()
}
mmushtaq
  • 3,316
  • 7
  • 29
  • 46
Umang Patwa
  • 2,477
  • 3
  • 26
  • 39

2 Answers2

0

In View

@Html.ActionLink("Register", "Signup", "Account", null, new { @class = "call-to-action", id = "registerLink" })

Controller

  [ActionName("Signup")]
    public ActionResult Register() 
    {
        return View();
    }
mmushtaq
  • 3,316
  • 7
  • 29
  • 46
0

Why are you putting an ActionName data annotation over the actual action?

In order to get this to work, all you need to do is:

HTML:

@Html.ActionLink("Register", "Register", "Account", null, htmlAttributes: new { @class = "call-to-action", id = "registerLink" })</li>

Controller:

//no need for data annotation
public ActionResult Register() 
{
    return View();
}

Let me know if this helps.

Grizzly
  • 5,671
  • 6
  • 47
  • 101