用戶控件開發,后臺動態向Controls里添加了控件,則前臺頁面不能用<%= %>塊,而前臺的JS代碼的確有需要用到后臺的屬性,應該怎么辦?
1 回答

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