我的自定义模型活页夹已经完美运行,开始给我错误
详情如下
已添加具有相同键的项目。描述:一个 在执行当前Web期间发生了未处理的异常 请求。请查看堆栈跟踪以获取有关的更多信息 错误以及它在代码中的起源。
异常详细信息:System.ArgumentException:具有相同键的项 已被添加。
来源错误:
第31行:{第32行:string key = bindingContext.ModelName;第33行: var doc = base.BindModel(controllerContext,bindingContext)as 文献;第34行:第35行:// DoBasicValidation(bindingContext,doc);
源文件:C:\ Users \ Bich Vu \ Documents \ Visual Studio 2008 \项目\ PitchPortal \ PitchPortal.Web \装订\ DocumentModelBinder.cs 行:33
堆栈追踪:
[ArgumentException:已添加具有相同键的项目。] System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +51 System.Collections.Generic.Dictionary2.Insert(TKey key,TValue value,Boolean add)+7462172 System.Linq.Enumerable.ToDictionary(IEnumerable1 source,Func2 keySelector,Func2 elementSelector,IEqualityComparer1 comparer)+270 System.Linq.Enumerable.ToDictionary(IEnumerable1 source,Func2 keySelector,IEqualityComparer1 comparer)+102 System.Web.Mvc.ModelBindingContext.get_PropertyMetadata()+157 System.Web.Mvc.DefaultModelBinder.BindProperty(ControllerContext controllerContext,ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor)+158 System.Web.Mvc.DefaultModelBinder.BindProperties(ControllerContext controllerContext,ModelBindingContext bindingContext)+90 System.Web.Mvc.DefaultModelBinder.BindComplexElementalModel(ControllerContext controllerContext,ModelBindingContext bindingContext,Object model) +50 System.Web.Mvc.DefaultModelBinder.BindComplexModel(ControllerContext controllerContext,ModelBindingContext bindingContext)+1048 System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext,ModelBindingContext bindingContext)+280 PitchPortal.Web.Binders.documentModelBinder.BindModel(ControllerContext controllerContext,ModelBindingContext bindingContext)in C:\ Users \ Bich Vu \ Documents \ Visual Studio 2008 \项目\ PitchPortal \ PitchPortal.Web \装订\ DocumentModelBinder.cs:33 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext,ParameterDescriptor parameterDescriptor)+257 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext,ActionDescriptor actionDescriptor)+109 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext,String actionName)+314 System.Web.Mvc.Controller.ExecuteCore()+ 105 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +39 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)+7 System.Web.Mvc。<> c_DisplayClass8.b_4()+34 System.Web.Mvc.Async。<> c_DisplayClass1.b_0()+ 21 System.Web.Mvc.Async<> c__DisplayClass81.b__7(IAsyncResult的 _)+12 System.Web.Mvc.Async.WrappedAsyncResult1.End()+59 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +44 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult) 结果)+7 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8677678 System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously)+155
任何想法的家伙?感谢