为什么不在代码后面识别iframe id [英] why don't recognize Iframe id in code behind
本文介绍了为什么不在代码后面识别iframe id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的iframe
< iframe id =myIframesrc =style =position:static; top:1px; right:1px; bottom:1px; left:0px;高度:200px;宽度:100px;>< / iframe>
但在后面的代码中无法识别myIframe!为什么?
this is my iframe
<iframe id="myIframe" src="" style=" position: static; top: 1px; right: 1px; bottom: 1px; left: 0px; height: 200px; width: 100px; " ></iframe>
but in behind code don't recognize myIframe! why?
推荐答案
向你的iframe标签添加一个属性runat =server
< iframe id =myIframe runat =server src =style =position:static; top:1px; right:1px; bottom:1px; left:0px; height:200px; width: 100px;>< / iframe>
Add an attribute runat="server" to you iframe tag
<iframe id="myIframe" runat="server" src="" style=" position: static; top: 1px; right: 1px; bottom: 1px; left: 0px; height: 200px; width: 100px; " ></iframe>
这篇关于为什么不在代码后面识别iframe id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文