如何使用 Url.Action
iframe
中的方法src
属性。喜欢
<iframe src = '<%=Url.Action("HelloWorld", "myController");%>' width = "100%" height="1000" frameBorder="0"></iframe>
但它不能正常工作。它说请求的内容不可用。
请帮我
最佳答案
使用 ASP.NET 引擎
<iframe src = '<%: Url.Action("HelloWorld", "myController") %>' width = "100%"
height="1000" frameBorder="0"></iframe>
使用 Razor 引擎。
<iframe src = '@Url.Action("HelloWorld", "myController")' width = "100%"
height="1000" frameBorder="0"></iframe>
关于asp.net-mvc-4 - 如何在 iframe src 中使用 Url.Action,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17675263/