Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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:
 
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:
<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 27-Mar-13 23:26pm
Edited 3-Apr-13 3:56am
v9
Comments
Guptha Ch at 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 at 29-Mar-13 0:43am
   
Hey Check it out I have updated question.
Guptha Ch at 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 at 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....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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));
}
  Permalink  

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

  Print Answers RSS
0 Kornfeld Eliyahu Peter 169
1 Zoltán Zörgő 139
2 George Jonsson 135
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 18 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100