0

私は自分自身を取得していますが、既知のバグではありません。別のアクションのこのコードは正常に動作します

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 , Object ) +66
System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +438 ASP._Page_Views_Kamikaze2_TestGamePlay_cshtml.Execute() 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.WebPages.StartPage.RunPage() +58
System.Web.WebPages.StartPage.ExecutePageHierarchy() +94
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext、TextWriter ライター、WebPageRenderingBase startPage) +172
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext、TextWriter ライター、オブジェクト インスタンス) +574
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext、TextWriter ライター) +360
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext ) context) +409 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
System.Web.Mvc.<>c_ DisplayClass1c.b _19() +60 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter) filter, ResultExecutingContext preContext, Func 1 継続) +391 System.Web.Mvc.<> c_DisplayClass1e.b1 continuation) +391
System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +61 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func

_1b() +61 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext、IList 1.b__7(IAsyncResult ) +42 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +141 System.Web.Mvc. Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object タグ) +54 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object タグ) +40 System.Web.Mvc.<> c_DisplayClasse.b_d () + 61 System.Web.Mvc.SecurityUtil.b _0(アクション f) +31 System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(アクション アクション) +56 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +1101 filters, ActionResult actionResult) +285
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.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 結果) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8967757 System.Web.HttpApplication.ExecuteStep(IExecutionStep ステップ) , Boolean& completedSynchronously) +184

4

1 に答える 1

1

このエラーは、Model が null であるために発生します

于 2012-04-29T05:18:31.167 に答える