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:
<iframe src="/ProductsController/Index?WebForm1.aspx" width="1000" height="400">
</iframe>
my Views/web.config is set as next:
and the WebForm inheritance is as next:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
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."
I tried also to add to my global.asax file the next line:
RouteTable.Routes.RouteExistingFiles = true;
but failed also,
The unique way I get iFrame displayed but empty is to use the full physical path as next:
<iframe src="C\:Folder1\Folder2\ ...\Views\Products\WebForm1.aspx" width="1000" height="400">
</iframe>
can someone explain why it does not work? And how to make it work? Thank you.