MVC模式开发asp.net应用的一个小错误
The parameters dictionary contains a null entry for parameter 'cateId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult List(Int32)' in 'CMSProject.Controllers.ContentsController'. To make a parameter optional its type should be either a reference type or a Nullable type.
参数名: parameters 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息:
System.ArgumentException: The parameters dictionary contains a null entry for parameter 'cateId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult List(Int32)' in 'CMSProject.Controllers.ContentsController'. To make a parameter optional its type should be either a reference type or a Nullable type.
参数名: parameters
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[ArgumentException: The parameters dictionary contains a null entry for parameter 'cateId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult List(Int32)' in 'CMSProject.Controllers.ContentsController'. To make a parameter optional its type should be either a reference type or a Nullable type.
参数名: parameters]
System.Web.Mvc.ReflectedActionDescriptor.ExtractParameterFromDictionary(ParameterInfo parameterInfo, IDictionary`2 parameters, MethodInfo methodInfo) +158895
System.Web.Mvc.<>c__DisplayClass1.<Execute>b__0(ParameterInfo parameterInfo) +18
System.Linq.WhereSelectArrayIterator`2.MoveNext() +78
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +259
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +81
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +135
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +52
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +254
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +192
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +399
System.Web.Mvc.Controller.ExecuteCore() +126
System.Web.Mvc.ControllerBase.Execute(RequestContext re