Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a SharePoint-2013 web-part in that I have created Application Page.

In that page I am using <iframe> element. But it is giving me error like:

XML
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 362:                <tr>
Line 363:                    <td>
Line 364:                        <iframe id="frame1" frameborder="0"  runat="server" scrolling="no" width="100%" height="200px" style="margin: 0px; padding: 0px;" visible="false"></iframe>
Line 365:                    </td>
Line 366:                </tr>


Source File: /_layouts/15/OpportunityViewWP/Dashboard.aspx    Line: 364

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


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

Code Which I have used:
XML
<tr>
    <td>
        <iframe id="frame1" frameborder="0"  runat="server" scrolling="no"
               width="100%" height="200px" style="margin: 0px; padding: 0px;"
               visible="false"></iframe>
    </td>
</tr>


What is the reason behind this? Can anyone help me to solve this problem.?

Thanks in advance.!!
Posted
Updated 3-Apr-13 2:56am
v9
Comments
Guptha Ch 28-Mar-13 11:22am    
Can u post the complete code in the Application page.Which will be more helpful to answer your question
Rahul Gokani 29-Mar-13 0:43am    
Hey Check it out I have updated question.
Guptha Ch 29-Mar-13 5:18am    
Hey I need the complete page code to analyse not just where the parse error is coming as the application pages wont support the controls in some parts of the layout
Rahul Gokani 30-Mar-13 12:21pm    
Hey, This is the only thing that I am using in this page. The other code is nothing but the SharePoint's necessary import and register statements.... nothing else....

 
Share this answer
 
v2
it solved using code behind c# in your web part or your Application page as follow

public partial class VisualWebPart1UserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{


string url = "" ;

string output;
output = "
<iframe style=" + "width:1000px;height:750px" + " src="+ url +" ></iframe>
";

this.Controls.Add(new LiteralControl(output));
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900