asp.net-mvc-3 – MVC3值不能为null 参数名称:值
发布时间:2020-05-23 08:34:58 所属栏目:asp.Net 来源:互联网
导读:我试图加载用户的数据编辑它,然后保存。这已经工作,我不太确定我改变了,但现在我得到以下错误… Value cannot be null.Parameter name: valueDescription: An unhandled exception occurred during the execution of the current web request. Please revi
|
我试图加载用户的数据编辑它,然后保存。这已经工作,我不太确定我改变了,但现在我得到以下错误… Value cannot be null.
Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: value
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: value]
System.ComponentModel.DataAnnotations.ValidationContext.set_DisplayName(String value) +51903
System.Web.Mvc.<Validate>d__1.MoveNext() +135
System.Web.Mvc.<Validate>d__5.MoveNext() +318
System.Web.Mvc.DefaultModelBinder.OnModelUpdated(ControllerContext controllerContext,ModelBindingContext bindingContext) +139
System.Web.Mvc.DefaultModelBinder.BindComplexElementalModel(ControllerContext controllerContext,ModelBindingContext bindingContext,Object model) +66
System.Web.Mvc.DefaultModelBinder.BindComplexModel(ControllerContext controllerContext,ModelBindingContext bindingContext) +1367
System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContext controllerContext,ModelBindingContext bindingContext) +449
System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext,ParameterDescriptor parameterDescriptor) +317
System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext,ActionDescriptor actionDescriptor) +117
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext,String actionName) +343
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8897857
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously) +184
public ActionResult EditDetails()
{
int id = Convert.ToInt32(Session["user"]);
S1_Customers u1_users = storeDB.S1_Customers.Find(id);
return View(u1_users);
}
[HttpPost]
public ActionResult EditDetails(S1_Customers u1_users)
{
var Pcode = "";
if (ModelState.IsValid)
{
我甚至没有达到ModelState.IsValid当我点击提交 解决方法你更改了任何名字吗?表单名称必须与您的Action参数映射1-1。在这种情况下,“name”参数未传递到控制器操作,因此它为null。野生猜测,需要更多的信息(动作的方法签名) (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 在IIS 7.5上使用传出异步Web请求时的可扩展性问
- asp.net – 当用户使表单失效时,如何点击取消按钮时,如何清
- asp.net-mvc-3 – 剃刀引擎 – SEO元标签
- asp.net-mvc – 如何覆盖Orchard CMS中导航区域的渲染?
- 取消选中时,ASP.NET CheckBox不会启动CheckedChanged事件
- 在ASP.NET中设置ECommerce
- asp.net-mvc – 通用列表属性的必需属性
- asp.net – 由TaskScheduler和SynchronizationContext混淆同
- asp.net-mvc – 使用Html.RouteLink添加一个css类
- asp.net – 如何将IIS Developer Express切换到“经典模式”
推荐文章
站长推荐
热点阅读
