<% 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.
source
share