title: iframe in an MVC view to load asp.net web form
body: <p>I have a controller called ProductsController and I use the index method to load the index view with a web form inside called WebForm1.aspx, The index view has been set up and is working properly. Now I want to add an iframe in the index view to display the content of WebForm1.aspx. Both views are in the same folder Views/Products in the MVC project. I did the following:</p>
  
  <pre><code>    &lt;iframe src="/ProductsController/Index?WebForm1.aspx" width="1000" height="400"&gt;
  
      &lt;/iframe&gt;
  </code></pre>
  
  <p>my Views/web.config is set as next:</p>
  
  <p>
    
    
  </p>
  
  <p>and the WebForm inheritance is as next:</p>
  
  <pre><code>&lt;%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage&lt;dynamic&gt;" %&gt;
  </code></pre>
  
  <p>Yet the iframe display an error message: "HTTP 404 - The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable."</p>
  
  <p>I tried also to add to my global.asax file the next line:</p>
  
  <pre><code>RouteTable.Routes.RouteExistingFiles = true;
  </code></pre>
  
  <p>but failed also, </p>
  
  <p>The unique way I get iFrame displayed <strong>but empty</strong> is to use the full physical path as next:</p>
  
  <pre><code>    &lt;iframe src="C\:Folder1\Folder2\ ...\Views\Products\WebForm1.aspx" width="1000" height="400"&gt;
  
      &lt;/iframe&gt;
  </code></pre>
  
  <p>can someone explain why it does not work? And how to make it work? Thank you.</p>