在服务器端修改HTML控件的属性

Iframe不是服务器端控件。可以如下修改。

在aspx中:

 <iframe id="i" runat="server">
 </iframe>

将Iframe的runat修改为"server"。

在服务器端进行如下处理:

 this.i.Attributes.Add("src", "http://www.google.com/"); 

原文地址:https://www.cnblogs.com/rxie/p/1761664.html