如何在iframe src中使用Url.Action

use*_*740 7 iframe url-action asp.net-mvc-4

如何Url.Actioniframe src属性中使用该方法.喜欢

<iframe src = '<%=Url.Action("HelloWorld", "myController");%>' width = "100%" height="1000" frameBorder="0"></iframe>
Run Code Online (Sandbox Code Playgroud)

但它不能正常工作.它说所要求的内容不可用.

请帮我

Sat*_*pal 11

使用ASP.NET引擎

<iframe src = '<%: Url.Action("HelloWorld", "myController") %>' width = "100%" 
    height="1000" frameBorder="0"></iframe>
Run Code Online (Sandbox Code Playgroud)

使用剃须刀引擎.

<iframe src = '@Url.Action("HelloWorld", "myController")' width = "100%" 
    height="1000" frameBorder="0"></iframe>
Run Code Online (Sandbox Code Playgroud)