用戶控件開(kāi)發(fā),后臺(tái)動(dòng)態(tài)向Controls里添加了控件,則前臺(tái)頁(yè)面不能用<%= %>塊,而前臺(tái)的JS代碼的確有需要用到后臺(tái)的屬性,應(yīng)該怎么辦?
1 回答

慕桂英3389331
TA貢獻(xiàn)2036條經(jīng)驗(yàn) 獲得超8個(gè)贊
什么邏輯前面不能用<%%>??
public UserControl uc;
protected void Page_Load(object sender, EventArgs e)
{
UserControl uc = this.LoadControl(".....") as UserControl;
this.uc=uc;
this.Controls.Add(uc);
}
前面頁(yè)面不是可以引用uc的所有屬性了?
不懂你問(wèn)的是不是這個(gè),說(shuō)得不太清楚
- 1 回答
- 0 關(guān)注
- 476 瀏覽
添加回答
舉報(bào)
0/150
提交
取消