Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Url.Action in iframe src

How to use the Url.Action method in the iframe src attribute. Like

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

But its not working properly. Its saying that the requested content is not available.

Please help me

like image 954
user1268740 Avatar asked Jul 16 '13 11:07

user1268740


1 Answers

Using ASP.NET engine

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

Using razor engine.

<iframe src = '@Url.Action("HelloWorld", "myController")' width = "100%" 
    height="1000" frameBorder="0"></iframe>
like image 174
Satpal Avatar answered Sep 20 '22 02:09

Satpal