CS1026: ) expected error when using IFrame in Content Page

Hi I had the following iframe defined in one of my aspx page.

<iframe id=”MyIframe” src=”http://www.bing.com&#8221; runat=”server” onload=”CallHello();”></iframe> 

The page was working fine. However as soon as I specified the same iframe inside a master page, I started getting following error. 

Compiler Error Message: CS1026: ) expected 
Source Error: 

 
 Line 4: </asp:Content>
Line 5: <asp:Content ID=”Content2″ ContentPlaceHolderID=”ContentPlaceHolder1″ Runat=”Server”>

Line 6: <iframe ….src=http://www.bing.com….

Line 7: </asp:Content>

Line 8:

 

So here to resolve the error either remove the runat or onload attribute.

 

Bye. 


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

1 thought on “CS1026: ) expected error when using IFrame in Content Page”

  1. Thanks for this but I would also love to know why this error occurs! What is it that causes these two properties to break when used inside a content page.

    Like

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s