views:

196

answers:

1

Is Response.Write() working with Razor?

I tried to use @Html.RenderAction but I'm getting the error:

CS1502: The best overloaded method match for 
'Microsoft.WebPages.WebPageUltimateBase.Write(Microsoft.WebPages.Helpers.HelperResult)'   
has some invalid arguments
+3  A: 

This is the correct syntax:

@{Html.RenderAction("Index", "Menu");}

Or just using Action:

@Html.Action("Index", "Menu")
stacker
stacker's got it. It's like using <%= to call a method that returns Void, you get a compiler error about not finding a correct overload. "@Foo" <==> "<%= Foo %>" and "@{Foo}" <==> "<% Foo %>"
anurse