无法绑定零引用的运行时
本文关键字:运行时 引用 绑定 | 更新日期: 2023-09-27 18:32:47
我为自己得到的不是一个已知的错误,这段代码在另一个操作中通常有效
Unable to bind the runtime of the zero reference
Description: An unhandled exception occurred during the execution of the current web request. Examine the stack trace for more information about this error and where it originated in the code.
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Unable to bind the runtime of the zero reference
Source Error:
Line 169:@for (int i = 1; i < 10; i++)
Line 170:{
Line 171: <span>@Ajax.ActionLink((i * 5).ToString(), "Start", new { cost = (i * 5), gameId = Model.IdGame }, AjaxStart)</span>
Line 172:}
Line 173:
[RuntimeBinderException: Не удается выполнить привязки исполняющей среды по нулевой ссылке] CallSite.Target(Closure , CallSite , 对象 ( +66
System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0( +438 ASP._Page_Views_Kamikaze2_TestGamePlay_cshtml。执行(( in c:''Users''User''Documents''Visual Studio 2010''Projects''Igrok56''Web''Views''Kamikaze2''TestGamePlay.cshtml:171
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(( +272
System.Web.Mvc.WebViewPage.ExecutePageHierarchy(( +67
System.Web.Web.WebPages.StartPage.RunPage(( +58
System.Web.WebPages.StartPage.ExecutePageHierarchy(( +94
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage( +172
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, 文本编写器编写器,对象实例(+574
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer( +360
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context( +409 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext 控制器上下文,操作结果操作结果( +39
System.Web.Mvc.<>c_DisplayClass1c.b_19(( +60 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) +391
1 延续( +391
System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +61 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
System.Web.Mvc.<>c_DisplayClass1e.b_1b(( +61 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) +285
1.b__7(IAsyncResult ( +42 System.Web.Mvc.Async.WrappedAsyncResult'1.End(( +141 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, 对象标签( +54
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +830
System.Web.Mvc.Controller.ExecuteCore() +136
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +232 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +68
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44
System.Web.Mvc.Async.<>c__DisplayClass8
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, 对象标签( +40
System.Web.Mvc.<>c_DisplayClasse.b_d(( +61
System.Web.Mvc.SecurityUtil.b_0(Action f( +31 System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action( +56 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult( +110
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 结果( +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute(( +8967757 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completeSynchronously( +184
发生此错误的原因是 Model 为空