-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,430
  • 7
  • 30
  • 47
Umang Patwa
  • 2,795
  • 3
  • 32
  • 41

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,430
  • 7
  • 30
  • 47
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,873
  • 8
  • 56
  • 109