Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc MVCContrib输入格式和SparkViewEngine出现故障_Asp.net Mvc_Spark View Engine_Mvccontrib_S#arp Architecture - Fatal编程技术网

Asp.net mvc MVCContrib输入格式和SparkViewEngine出现故障

Asp.net mvc MVCContrib输入格式和SparkViewEngine出现故障,asp.net-mvc,spark-view-engine,mvccontrib,s#arp-architecture,Asp.net Mvc,Spark View Engine,Mvccontrib,S#arp Architecture,我正在尝试使用MVCContrib InputBuilders,但遇到了问题。我也在使用Sarp架构和spark。我的spark视图如下所示: new.spark: <viewdata model="NewUserViewModel" /> ${Html.InputForm<NewUserViewModel>()} My global.asax.cs包含: protected void Application_Start() { XmlConfigurato

我正在尝试使用MVCContrib InputBuilders,但遇到了问题。我也在使用Sarp架构和spark。我的spark视图如下所示:

new.spark:

<viewdata model="NewUserViewModel" />
${Html.InputForm<NewUserViewModel>()}
My global.asax.cs包含:

  protected void Application_Start() {
    XmlConfigurator.Configure();
    var controller = InitializeServiceLocator();
    ModelBinders.Binders.DefaultBinder = new SharpModelBinder();            
    ViewEngines.Engines.Clear();
    InputBuilder.BootStrap();
    ViewEngines.Engines.Add(controller.Resolve<IViewEngine>());
    RouteRegistrar.RegisterRoutesTo(RouteTable.Routes);
  }

我讨厌回答我自己的问题,但我发现在/Views/Web.config下添加它可以修复我的问题

    <pages
    validateRequest="false"
    pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <controls>
            <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
        </controls>
    </pages>

我真的不知道为什么会有帮助。我的猜测是,我的应用程序被配置为只使用spark视图,这是在重新添加常规视图引擎,但我在这里不是专家。

虽然这没有多大帮助,因为现在表单只是插入页面的外部和顶部,而不是呈现在它应该在内部的内容块中。