- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
当我的 View 调用 Html.RederPartial
时,我得到一个 System.Web.HttpCompileException
。异常信息是:
Additional information: External component has thrown an exception.
我已经检查过:
模型
和 View 接收的是一样的。InnerException
为空异常听起来应该是 html 或 razor 格式不正确或不正确,但解决方案构建良好。它也在不久前工作,所以我猜,我错过了一些愚蠢的东西......
我的问题:
有谁知道如何知道导致此异常的原因?或者有没有办法获得有关异常的更多信息?
编辑:这是 StackTrace
at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean ...
最佳答案
原来这是我犯的一个愚蠢的错误。 MVC 无法从 Razor
编译 Html
,因为我在 Model
中重命名了一个属性,但没有在 中更新它>.cshtml
。
在编译时打开 Razor Build 错误。编辑您的 csproj
文件并设置以下内容:
<MvcBuildViews>true</MvcBuildViews>
感谢 JP 提供此 SO post .
关于c# - Html.RenderPartial 上的 MVC System.Web.HttpCompileException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31608851/
哪个性能最好。我有一个包含文章列表的列表数组。当我列出文章时,我有一个只显示一篇文章的 RenderPartial,父页面遍历所有文章的循环。 Renderpatial 位于父页面循环内。解决此问题的
我收到一个类型错误,但我不明白为什么,我有一个 View、一个 ViewModel、一个 PartialView 和一个 Model。 View 礼物以 giftViewModel 作为模型。gift
我有一些选项卡,我想在单击选项卡时在第二个选项卡内调用 RenderPartial (overviewTab)。 现在,RenderPartial 在页面加载时加载,但我只想在单击概述选项卡时加载它。
这是我的文件夹结构 我想从我所在区域的 View 中调用局部 View 最佳答案 您可以在渲染 View 时指定 View 的完整位置: 更新: 为了从 Shared 文件夹调用部分: 关于c#
我在 protected/views/directory_controller_name 下有一个 php 文件,格式如下 title;?> ... 我在 Controller 中使用经典方法显示
不太明白renderpartial方法中的第三个和第四个参数(return和processOutput)是干什么的。这是我在 Yii 的文档中找到的内容: public string renderPa
我们的网络应用程序包含数十个局部 View ,其中一些是其他 View 的 subview 。我们注意到应用程序在第一次加载时速度很慢,它需要 0.5 到 1 秒来初始化它第一次调用的每个 View
大家好。 我知道这是 MVC 方面的一个非常基本的问题,但我一生都无法让 @Html.RenderPartial 不给我错误。我正在使用 VB.NET 和 Razor。我在网上找到的大多数示例都是用
简短但简单? 我有一个 edit.ascx 在共享文件夹中。我这样调用它: 如果我把它放在子文件夹中,它找不到文件,如何解决? 最佳答案 In terms of how you arrange yo
我有以下代码呈现一个名为 ExchangeRates.ascx 的控件。我想将两个变量传递给控件,currencyCode 和 toCurrencyCode,但我只知道如何传递一个。谁能帮忙?
嗨,我有这行代码: 我需要做的是通过覆盖中可用的附加参数将我的模型传递给它。我写什么?我的模型是 field 。谢谢。 最佳答案 您可以使用 following overload允许您将模型传递给部
这是一个场景:假设我的站点有两个 Controller ,负责显示不同类型的内容 - 页面和文章。我需要将部分 View 嵌入到我的主页中,该主页将列出按某些条件过滤的页面和文章,并显示在每个页面上。
首先,请注意,我注意到具有分页器的常见 Yii 小部件可以转到任何页面而无需重新加载页面,而只需通过 AJAX 请求它,然后更改已加载页面的内容。这样的行为完全可以满足我现在的需求。 我的一个 Vie
我将一些部分 View 链接在一起,并且我需要一种在调用 RenderPartial() 时使用不同模型的方法。大多数关于 SO 的答案都说明要转换为模型类型,但这在编译时是未知的。 该网站有不同的类
我正在尝试结合 ASP.net、knockout 和 javascript 来呈现交互式树。树中的每个节点都有一个“项目”列表和一个“组”列表,其中每个“组”是另一个节点。以下是每个节点最简单形式的
我尝试了很多组合,但仍然出现运行时错误: @{Html.RenderPartial("~/Views/_" + @Model.Id + ".cshtml")}; 有什么明显的我错了。我在模型中正确设置
我当前在我的 View 中渲染 3 个 CGridview,全部使用“renderPartial”和相同的 php 文件。这工作得很好,除了使用分页时,并且用户选择另一页结果时,它会将所有 CGrid
您好,我想知道 mvc C#s 渲染操作是否与直接在我的评论中调用部分一样有效,如果不是,那么效率有多低。 最佳答案 RenderAction 肯定会比 RenderPartial 慢。差异将取决于您
我有一个页面 View ,它进行 ajax 调用并使用 renderPartial 更新页面内容。 所以 page.php -> _pagePartial.php (ajax 更新) 在 page.p
我正在开发一个使用 Yii 框架的项目。当前页面正确加载并传递变量:picks:包含 16 个选项的数组,ticket_ID:只是一个普通 ID。 我想做的是,当按下重置按钮时,调用设置 16 个数组
我是一名优秀的程序员,十分优秀!