日期:2014-05-16  浏览次数:20451 次

Html如何嵌套ascx控件
ascx用一个datalist来显示图片,如何嵌套在Html页面里,用iframe一直出现如下的错误

代码是这样:<iframe src="ascx/sy1.ascx" width="500px;"></iframe>

图片一直上传不成功,错误代码是这样的:
This page contains the following errors:
error on line 1 at column 2: StartTag: invalid element name
Below is a rendering of the page up to the first error.
希望高手帮帮忙啊!谢谢
------解决方案--------------------
为什么要嵌套在html页面里,你这做法完全不明所以
------解决方案--------------------
ascx是页面控件   你怎么能用iframe呢?

新建一个aspx的页面  吧代码拷过去    用iframe引用aspx
------解决方案--------------------
asp.net中哪还那样弄的?
你可以在页面指定位置放置一个Panel,然后
var uc = this.LoadControl("ascx/sy1.ascx");
this.pnl.Controls.Add(uc);

注意,ascx有些初值设定要放在在Page_Init中