2012-06-26 2 views
0

은 내가 Helper.CustomActionLink이 메소드를 호출하려고하고에 전화 사용자 정의 actionlink 방법

public static IHtmlString CustomActionLink(this HtmlHelper htmlHelper, int userId, string controller, string linkText, string action) 
    { 
     int userID = userId; 
     bool isAllowed = checkPermission(userID,action,controller); 
     if (isAllowed == false) 
     { 
      return MvcHtmlString.Empty; 
     } 
     return htmlHelper.ActionLink(linkText, action); 
    } 

actionlink이 사용자 정의를 만들 해결 방법 (4, "MYCONTROLLER", "텍스트", "시켜라") 하지만 첫 번째 인수를 전달하는 저를 요구하는 것은 '이것은 Html 헬퍼 Html 헬퍼'내가 해결 방법이

답변

2

이 같이 호출해야 작동

@Html.CustomActionLink(4,"myController","text","MyAction") 
+0

감사합니다 –