Reputation: 9081
I am beginner in asp.net mvc. I have in the view Home.cshtml
<a href="" style="color:blue; margin-top : 30px;">Créer un nouveau compte</a>
I'd like to associate this link to this action in the controller SuperController
public ActionResult Admin_creation()
{
return RedirectToAction("Admin_creation");
}
How can i do this?
Upvotes: 0
Views: 109
Reputation: 4009
Yes - you can use:
@Html.ActionLink("Text on screen", "Method name", "Controller name");
so going by your snippet above yours should read:
@Html.ActionLink("Créer un nouveau compte", "Admin_creation", "SuperController");
Upvotes: 2
Reputation: 70718
Use Url.Action
or ActionLink
:
@Url.Action("Admin_Creation", "Super");
Or:
@Html.ActionLink("Créer un nouveau compte", "Admin_creation");
Upvotes: 3