iframe problem

  • Thread starter Thread starter seans
  • Start date Start date
S

seans

Hi, please, can somebody help me with this? I have an iframe on a form.
I need to add "runat=server" to the iframe tag to convert to a HTML
Server control. When I do that I get the error CS1012: "Too many
characters in character literal" when I try to compile the project.
Here's the line in the code:

<iframe id="iframe" runat="server" name="i-frame" align="middle"
marginWidth="1" src="getpage.aspx?pid=1" frameBorder="1" width="100%"
onload="parent.addItems(parent.frames['iframe'].window.document);InitDataBoundTable();"
height="396"></iframe>

The length of the line is not the issue. I tried making the line
shorter by removing some of the other attributes but that didn't help.
Removing the "runat=server" fixes the problem.

thanks,

sean
 
Hi,

How are you declaring the iframe in the code behind?

it should be HtmlGenericControl , I have never made reference to an iframe,
so not sure if you can even do it (probably yes), are you sure you are not
missing|excesing a "


cheers,
 
Hi Ignacio thanks for your reply. The iframe is declared as a
HtmlGenericControl.

I think the 'onload' may be the issue as onload is not an attribute of
iframe.

cheers.
sean.
 
The problem is that "onload" is not an attribute of iframe. Is there a
way to declare that the onload is a JavaScript event and not an iframe
attribute?

thanks again.

sean
 
Back
Top