0
나는 다음과 같은 조치가있다 :HttpVerbs.Get 및 매개 변수?
http://MyServer/Integration/Feed/MyTest
하지만 feedKey
가 null :
public class IntegrationController : Controller
{
[AcceptVerbs(HttpVerbs.Get)]
public ContentResult Feed(string feedKey)
{
...
}
}
나는이 URL을 사용하려고 노력 해요? 이것은 루트와 관련이 있습니까?
편집 1 :
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Ad", action = "List", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"TreeEditing", // Route name
"{controller}/{action}/{name}/{id}", // URL with parameters
new { controller = "AdCategory", action = "Add", name = string.Empty, id = -1 }
);
편집 2 :
routes.MapRoute(
"IntegrationFeed", // Route name
"{controller}/{action}/{name}/{feedKey}", // URL with parameters
new { controller = "Integration", action = "Feed", name = string.Empty, feedKey = "" }
);
정의한 경로는 무엇입니까? – jrummell
회신을 통해 업데이트되었습니다. – Ivy