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

标签 razor asp.net-mvc-3

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

我尝试使用 @Html.RenderAction但我收到错误:

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

最佳答案

这是正确的语法:

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

或者只是使用操作:
@Html.Action("Index", "Menu")

关于razor - Response.Write() 是否与 Razor 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3383618/

相关文章:

c# - 单线在哪里?

asp.net-mvc-3 - mvc dropdownlistfor 未标记为必需,但仍然是必需的

c# - 如何对 WebGrid 中的多列进行排序?

c# - 如何访问 Razor 引擎 View 文件中的 C# 类属性?

asp.net-mvc - 将数据放入交替的表列中

c# - 在 ASP.NET MVC 中格式化 Razor 中的值

ASP.NET MVC : Correct location for custom classes, 属性等

mysql - 如何用 MySQL DB 替换 SQL DB 并启用 Entity Framework Code First?

c# - 我在一个 View 中混合了创建 View 和索引 View 代码。那么,如何通过 asp.net MVC4 中的 View 从数据库中检索数据?

html - 如何强制 Razor 不生成额外的 html 属性