之间我必须使用定制IsWWWAttribute属性,从ActionMethodSelectorAttribute继承2个操作,我正在试图调用POST方法时出现以下错误:ActionMethodSelectorAttribute迷路方法
System.Reflection.AmbiguousMatchException 的当前请求在控制器类型'AccountsController'上操作'forgotpassword'在以下操作方法之间不明确:System.Web.Mvc.ActionResult ForgotPassword()对类型.Controllers.AccountsController System.Web.Mvc.ActionResult忘记密码(.Models.ForgotPasswordModel)on类型.Controllers.AccountsController
[IsWWW]
public ActionResult ForgotPassword()
{
// SOME CODE
}
[HttpPost]
[IsWWW]
public ActionResult ForgotPassword(ForgotPasswordModel model)
{
// SOME CODE
}
自定义属性:
public class IsWWWAttribute : ActionMethodSelectorAttribute
{
public override bool IsValidForRequest(ControllerContext controllerContext, System.Reflection.MethodInfo methodInfo)
{
return Configuration.Subdomain.SubDomainID == 0;
}
}
如果我删除[IsWWW]然后调用后行动工作正常!
我在这里错过了什么!