Reputation: 131
My structure of Controllers and Views is as follow
Controller
|_Disorders
| |_Anxiety
| |_AnxietyController
| HomeController
Views
|_Anxiety
| |_Anxiety.aspx
|_Home
|_Index.aspx
I am trying to call this from partial view which is located as follow:
Views
|_Shared
| |_Header.ascx // header is included in Site.Master
|
|Site.Master
I am putting this code in Header.ascx
<li><% Html.ActionLink("Home", "Index", "Home"); %></li>
<li><% Html.ActionLink("Anxiety", "Anxiety", "Anxiety"); %></li>
I have followed this Html.ActionLink(linktext, Actionname, controllername)
but unable to fix it.
Its in MVC3
Upvotes: 0
Views: 629
Reputation: 239290
The controller param isn't a path. It's just the name of the controller, i.e. _Anxiety
based on your class of _AnxietyController
. (The Controller
bit is left off intentionally. That is how the helper expects it. It knows all your controllers end in Controller
.)
Upvotes: 1