-1
只是想知道,如果有可能不拆以下步骤...提前创建时为控件分配属性?
Button b = new Button()
{
// You can access Attributes here, but only get, not set.
ID = "btnExample",
Text = "Click Me"
};
b.Attributes.Add("onclick", "alert('hello, world')");
感谢。
你为什么不试试呢? – codingbiz