Search code examples
asp.net-mvchtml-helper

MVC Html.BeginForm using Areas


I'm using MVC areas and on a view that's in an area called "Test" I would like to have a form that posts to the following method:

area: Security
controller: AccountController
method: logon

How can I make this happen with Html.BeginForm? Can it be done?


Solution

  • Try this:

    Html.BeginForm("logon", "Account", new {area="Security"})