开发者

iframe background color

开发者 https://www.devze.com 2022-12-10 07:21 出处:网络
How can I change iframe background color on design time? By design time I mean the following: My class extends CompositeControl where i implement design-time support.

How can I change iframe background color on design time?

By design time I mean the following: My class extends CompositeControl where i implement design-time support.

this is part of CreateChildControls():

 editor = new HtmlGenericControl("iframe");
 editor.ID = "editorID";
 editor.Style["background-color"] = "Red";
 editor.Style["color"] = "Black";
 editor.Style["position"] = "absolute";
 editor.Style["left"] ="0px";
 editor.Style["top"] = "0px";

 ed开发者_开发知识库itor.Attributes["width"] = editorWidth.ToString() + "px";
 editor.Attributes["height"] = editorHeight.ToString() + "px";
 editor.Attributes["frameborder"] = "0";
 editor.Attributes["scrolling"] = "auto";


You have to set the background of whatever page the iframe is pointed to (the src attribute) ;)

If the iframe is pointing to the same domain as you, then you could use Javascript to alter the background color or add an additional stylesheet - but this isn't at design time, either.

What is this iframe for?

0

精彩评论

暂无评论...
验证码 换一张
取 消