是的Response.Write()用剃刀工作吗? [英] Is Response.Write() working with Razor?

查看:124
本文介绍了是的Response.Write()用剃刀工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时的Response.Write()用剃刀工作?

我试图用 @ Html.RenderAction ,但我得到的错误:

  CS1502:为了获得最佳重载方法匹配
Microsoft.WebPages.WebPageUltimateBase.Write(Microsoft.WebPages.Helpers.HelperResult)'
有一些无效参数


解决方案

这是正确的语法:

  @ {Html.RenderAction(指数,菜单);}

或者只是用行动:

  @ Html.Action(指数,菜单)

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

解决方案

This is the correct syntax:

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

Or just using Action:

@Html.Action("Index", "Menu")

这篇关于是的Response.Write()用剃刀工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆