开发者

Spark view engine automatically applies H() to ${ ... }

开发者 https://www.devze.com 2022-12-10 19:06 出处:网络
This is part of my spark partial view (it is called TaskSearch): ${ Html.DropDownList(\"Search.Status\", Model.Statuses, \"All\") }

This is part of my spark partial view (it is called TaskSearch):

${ Html.DropDownList("Search.Status", Model.Statuses, "All") }

it is generated by non-spark view with code:

<% Html.RenderPartial(ControllerActions.TaskSearch, ViewData["TaskSearchModel"]); %>

Spark generates view class that contains

Output.Write(H( Html.DropDownList("Search.Status", Model.Statuses, "All") ));

which instead of creating html, creates html encoded html code, so I see html tags on output page, instead of dropdown list. I am propably missing something, but what should I do to disable H() usage in generated view?

I开发者_JS百科f I use

<%= Html.DropDownList("Search.Status", Model.Statuses, "All") %>

everything works fine.


I had

<spark>
    <pages automaticEncoding="true"/>
</spark>

in my web.config and

settings.SetAutomaticEncoding(true);

in global.asax and didn't notice it. Changing to false resolved the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消