Suppose you have a class like the following:
public class ItemController:Controller<br>{</p> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">public ActionResult Login(int id) { return View("Hi", id); }
}
If you want to create a link to the Login method from a page that is not located in the Item folder, where ItemController resides, you can use the HTML.ActionLink method with the following parameters:
Html.ActionLink(article.The above is the detailed content of How to Link to a Method in a Different Controller Using HTML.ActionLink?. For more information, please follow other related articles on the PHP Chinese website!