iFrame parser error after upgrading to .NET 4.5

后端 未结 10 2007
清酒与你
清酒与你 2020-12-02 19:27

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

相关标签:
10条回答
  • 2020-12-02 20:09

    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.

    0 讨论(0)
  • 2020-12-02 20:12

    Look into designer file, and replace Htmliframe for HtmlGenericControl in the control that has problems.

    0 讨论(0)
  • 2020-12-02 20:13

    My solution was to just rename the IFrame and rebuild and the designer file will be updated accordingly with the correct references.

    0 讨论(0)
  • 2020-12-02 20:14

    We were able to fix the issue converting the

    <iframe id="iframe" runat="server" />
    

    to

    <asp:HtmlIframe id="iframe" runat="server" />
    
    0 讨论(0)
  • 2020-12-02 20:14

    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.

    0 讨论(0)
  • 2020-12-02 20:14

    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
    
    0 讨论(0)
提交回复
热议问题