想自己做个留言版,想了下原来的方法都有在页面上面写信息,想换种角度试试,把代码都写到 Codebehind,想了半天就用了WEB控件,动态添加WEB控件时候需要赋值给它。下面就是一点体会。
Control UInfo=LoadControl("listInfo.ascx");
((listInfo)UInfo).ShowAddress(UMessageINFO);
this.PnlInfo.Controls.Add(UInfo);
可能很简单,但是需要摸索。
想自己做个留言版,想了下原来的方法都有在页面上面写信息,想换种角度试试,把代码都写到 Codebehind,想了半天就用了WEB控件,动态添加WEB控件时候需要赋值给它。下面就是一点体会。
Control UInfo=LoadControl("listInfo.ascx");
((listInfo)UInfo).ShowAddress(UMessageINFO);
this.PnlInfo.Controls.Add(UInfo);
可能很简单,但是需要摸索。