We have recently upgraded all of our WebForms projects to .NET 4.5, and encountered a parser issue when loading pages with an iFrame
element. We have corrected
Further (or in as a combination of the answers here).
I don't believe it's needed to actually change the tags from iframe
to asp:HtmlIFrame
if you have the reference to the updated System.Web.UI.HtmlControls
.
I updated my web.config to remove specific versions of the tag prefix and replace it with:
<add tagPrefix="asp" namespace="System.Web.UI.HtmlControls" assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Clean and rebuild the project and that regenerates all the designer tags for me with the correct HtmlIFrame
output.
Look into designer file, and replace Htmliframe for HtmlGenericControl in the control that has problems.
My solution was to just rename the IFrame and rebuild and the designer file will be updated accordingly with the correct references.
We were able to fix the issue converting the
<iframe id="iframe" runat="server" />
to
<asp:HtmlIframe id="iframe" runat="server" />
Check that you have next settings in your config file. Also make sure that it's there after publishing.
<system.web>
<httpRuntime targetFramework="4.5" />
<compilation debug="true" targetFramework="4.5"/>
...
</system.web>
Hope it's should help.
From .NET 4.5, Microsoft decided to change the iframe from a HtmlGenericControl to its own control, a HtmlIframe. so you have to change the
System.Web.UI.HtmlControls.HtmlGenericControls to System.Web.UI.HtmlControls.HtmlIframe