I have a controller called ProductController, and I use the index method to load the index view using a web form inside WebForm1.aspx, the index view is configured and working correctly. Now I want to add an iframe in the index view to display the contents of WebForm1.aspx. Both views are in the same Views / Products folder in the MVC project. I have done the following:
<iframe src="/ProductsController/Index?WebForm1.aspx" width="1000" height="400">
</iframe>
my Views / web.config is installed as follows:
and WebForm inheritance is as follows:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
However, the iframe displays an error message: "HTTP 404 - the resource you are looking for (or its dependencies) may have been deleted, its name changed or temporarily unavailable."
I also tried adding the following line to my global.asax file:
RouteTable.Routes.RouteExistingFiles = true;
but failed
The only way I get iFrame: but empty is to use the full physical path as follows:
<iframe src="C\:Folder1\Folder2\ ...\Views\Products\WebForm1.aspx" width="1000" height="400">
</iframe>
can someone explain why it is not working? And how to make it work? Thank.
source
share