Service Stack 4.0.15: Razor Partial not outputted inside @section

﹥>﹥吖頭↗ 提交于 2019-12-11 12:54:15

问题


Summary: Razor Partials don't get rendered inside a @section in ServiceStack 4. This seems to be a bug in ServiceStack.Razor.

Version: ServiceStack 4.0.15

Affected Package: ServiceStack.Razor

Razor partials inside a section does not get rendered.

Example

Inside _Layout.cshtml

@RenderSection("JavascriptConfig", required: false)

Inside home.cshtml

@section JavascriptConfig {
    @Html.Partial("_routes", Model.Lang)
}

Inside _routes.cshtml

@model string
test

If I look at the source code of the rendered View, there is no HTML outputted.


回答1:


I reported the issue on Github and a fix was posted in less than 19 hours! So, this issue is no longer an issue as of ServiceStack 4.0.16 (pre-release)

https://github.com/ServiceStack/Issues/issues/60



来源:https://stackoverflow.com/questions/22706219/service-stack-4-0-15-razor-partial-not-outputted-inside-section

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!