14

Response.Write() 是否与 Razor 一起使用?

我尝试使用@Html.RenderAction,但出现错误:

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

1 回答 1

22

This is the correct syntax:

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

Or just using Action:

@Html.Action("Index", "Menu")
于 2010-08-01T20:41:55.667 回答