The RenderAction is working just fine but as soon as I surround it with a if statement I get a compile error:
@if (@Model.IsConfigurationAllow)
{
@{ Html.RenderAction("Save"); } // CS1501: No overload for method 'Write' takes 0 arguments
}
More general question where can I found the grammar for the Razor view syntax?
Html.RenderActionrenders the HTML directly into the response, so you cant call it in a code block.The counterpart
Html.Actionreturns a string with the results.See http://haacked.com/archive/2009/11/17/aspnetmvc2-render-action.aspx