如何在代码隐藏中创建IFRAME [英] How to Create IFRAME in codebehind
本文介绍了如何在代码隐藏中创建IFRAME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在代码隐藏页面中动态创建iframe,我该怎么做,
Hi,I want to create a iframe dynamically in codebehide page ,how can i do so,
which class should i use.
推荐答案
请参见 ^ ]并查看它是否符合您的需求.
See http://bytes.com/topic/asp-net/answers/341453-create-iframe-dynamically[^] and see if it fits your needs.
尝试文字嵌入iFrame的控件:
Try Literal Control to embed an iFrame:
LiteralControl litCon = new LiteralControl();
litCon.Text = "<iframe name='testiFrame' id='runtimeIFrame' frameborder='no' scrolling='auto' height='400px' width='100%' src='http://www.google.com' style='left:0; background-color: beige;'></iframe>";
myPanel.Controls.Add(litCon);
参考: MSDN:LiteralControl类 [
Refer: MSDN: LiteralControl Class[^]
这篇关于如何在代码隐藏中创建IFRAME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文