작동하는 Ajax.RouteLink가 있습니다. 조각을 추가하고 싶습니다. 올바른 구문을 알아낼 수 없습니다. 조각없이Ajax.RouteLink에서 fragment를 사용하는 방법?
작동 경로 :
return Ajax.RouteLink(
linkText,
routeName,
new { caseNo = caseNo, controller = controllerName, option = contentOption },
new AjaxOptions() { UpdateTargetId = "caseContent", HttpMethod = "Post", OnBegin = onBegin, OnSuccess = onSuccess },
new { Class = cssClass + (contentOption != null && contentOption == contentView ? " active" : "") });
컴파일러 오류 RouteLink 단편 : routeValues와 htmlAttributes와
return Ajax.RouteLink(
linkText: linkText,
routeName: routeName,
protocol: null,
hostName: null,
fragment: fragment,
routeValues: new { caseNo = caseNo, controller = controllerName, option = contentOption },
ajaxOptions: new AjaxOptions() { UpdateTargetId = "caseContent", HttpMethod = "Post", OnBegin = onBegin, OnSuccess = onSuccess },
htmlAttributes: new { Class = cssClass + (contentOption != null && contentOption == contentView ? " active" : "") }
);
오류. 익명 형식을 변환 할 수 없습니다.
routeValues: new System.Web.Routing.RouteValueDictionary() { caseNo = caseNo, controller = controllerName, option = contentOption }
를하지만 그때 컴파일러 내 라우팅 PARMS (caseNo, 컨트롤러, 옵션)에 대한 불평 :
나는 시도했다.또한 프로토콜과 호스트 이름을 변경하지 않으므로 null로 남겨 두어도 괜찮습니까?
클래스는 예약되어 있지만 클래스는 아닙니다. 첫 번째 호출이 작동하는 것에 상관없이 그것이 현재 오류가 아니어도 관계 없습니다. – RitchieD
아 .... 설명 된대로 RouteValueDictionary와 그 컴파일을 수정했습니다. :) 감사. – RitchieD
routeValues : new System.Web.Routing.RouteValueDictionary {{ "caseNo", caseNo}, { "컨트롤러", 컨트롤러 이름}, { "옵션", contentOption}}, – RitchieD