폴더 외부 위치에서 컨트롤러로 작업하는 경우 원하는 메소드에 대한 링크를 생성해야 합니다. Html.ActionLink 메서드의 경우 다음 매개 변수가 필요합니다.
ASP.NET MVC1:
public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string controllerName, string actionName, object values, object htmlAttributes)
ASP .그물 MVC2:
public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, object values, object htmlAttributes)
ASP.NET MVC3 :
public static string ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, object values, object htmlAttributes)
다음 시나리오를 고려하세요.
public class ItemController:Controller { public ActionResult Login(int id) { return View("Hi", id); } }
외부 페이지에서 로그인 방법에 대한 링크를 생성하려면 Item 폴더에 다음 코드를 사용하세요:
위 내용은 ASP.NET MVC에서 해당 폴더 외부의 컨트롤러에 대한 작업 링크를 만드는 방법은 무엇입니까?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!