先编辑好 html文件,
然后
1) 把这个静态html文件中需要动态获得和改变的html标记,加上 runat=server,id=content
2) 在cs文件中 声明这样的 HtmlGenericControl 控件 protected System.Web.UI.HtmlControls.HtmlGenericControl content;
3) 在cs文件中就可以这样的设置属性了 this.content.Attributes["src"]="http://www.baidu.com";
然后
1) 把这个静态html文件中需要动态获得和改变的html标记,加上 runat=server,id=content
2) 在cs文件中 声明这样的 HtmlGenericControl 控件 protected System.Web.UI.HtmlControls.HtmlGenericControl content;
3) 在cs文件中就可以这样的设置属性了 this.content.Attributes["src"]="http://www.baidu.com";
浙公网安备 33010602011771号