1

I am creating a SharePoint-2013 web-part in that I have created Application Page.

In that page I am using <iframe> element only there are no any other elements just for testing. But it is giving me error like:

Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The base class includes the field 'frame1', but its type (System.Web.UI.HtmlControls.HtmlIframe) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlGenericControl).

Source Error:


Line 364:                <tr>
Line 365:                    <td>
Line 366:                        <iframe id="frame1" frameborder="0" runat="server" scrolling="no" width="100%" height="200px" style="margin: 0px; padding: 0px;" visible="false"></iframe>
Line 367:                    </td>
Line 368:                </tr>


Source File: /_layouts/15/OpportunityViewWP/MasterPage.aspx    Line: 366

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 

Below is the screenshot.

Parser Error Message

But when I am adding the same <iframe> in Visual-Web-Part it works properly.

Can anyone help me to solve this problem.?

Thanks in advance...!!

1

Go to your .cs designer file.

Change:
protected global::System.Web.UI.HtmlControls.HtmlGenericControl FinalScoreframe;
To:
protected global::System.Web.UI.HtmlControls.HtmlIframe FinalScoreframe;

Will solve your problem. :)

1

Change

<compilation targetFramework="4.0"/>

to

<compilation targetFramework="4.5"/>
  • I am new to sharepoint hence want to know where I can find 'targetFramework' attribute. I have checked web.config under VirtualDirectories\<port> but not able to find the respective attribute. – Manideep Yechuri Nov 15 '19 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.