How to use Html.RenderAction in SparkView Engine?

I get an error when I use it as

!{Html.RenderAction("Action", "Controller")}

I had to switch to the web form viewer and replace it with

<% Html.RenderAction("Action", "Nav"); %>

to make it work.

The error I get is "Unable to convert void to char"

+3
source share
2 answers
<% Html.RenderAction("Action", "Nav"); %>

coincides with

# Html.RenderAction("Action", "Nav");

in the Spark syntax. expression {} expects the result to be returned and written to the stream; RenderAction returns nothing, it writes the stream itself. This is why you have to call it inside a code block and cannot do it inside an expression.

+7
source

-:
<% %>=
<%= %>= , Response.Write(x), x == statement

Spark:
# == <% %>
${} == <% =% >

+4

Source: https://habr.com/ru/post/1729833/


All Articles