Yesterday I got the following error:
Parser Error Message: The base class includes the field ‘IFrame’, but its type (System.Web.UI.HtmlControls.HtmlIframe) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).
Source Error:
Line 14: <iframe id=”IFrame” frameborder=”0″ runat=”server” visible=”false”/>
Reason:
The code was written using .NET 3.5 but executed in the .NET 4.5 runtime. From .NET 4.5, Microsoft decided to change the iframe from a HtmlGenericControl to its own control, a HtmlIframe.
They did this with a wide range of controls for example System.Web.UI.HtmlControls.HtmlTableCell and System.Web.UI.HtmlControls.HtmlAnchor.
Solution:
You need to recompile the code using the .net 4.5 runtime.
And when doing this, you need to change the *.designer.cs file reference from:
protected global::System.Web.UI.HtmlControls.HtmlGenericControl IFrame;
To:
protected global::System.Web.UI.HtmlControls.HtmlIframe IFrame;
A bug has been reported that the VS2012 does not make this change itself, but all I had to do was to rename the ID of the IFrame control, and VS figured it out for me.
More information:
- https://connect.microsoft.com/VisualStudio/feedback/details/736011/iframe-parser-error
- http://forums.asp.net/t/1884696.aspx/1?help+required+with+iframes+on+aspx
Image may be NSFW.
Clik here to view.

Clik here to view.
