红牛电脑的回答:
foreach (Control var in Page.Controls) { if (var is Button) { string btnId = Page.ClientID; if (Regex.IsMatch(btnId, @"^btnd+$", RegexOptions.IgnoreCase)) { (var as Button).Attributes.Add("onclick", "xxx"); } } }
红牛电脑的回答:
红牛电脑的回答:
foreach (Control var in Page.Controls) { if (var is Button) { string btnId = Page.ClientID; if (Regex.IsMatch(btnId, @"^btnd+$", RegexOptions.IgnoreCase)) { (var as Button).Attributes.Add("onclick", "xxx"); } } }
红牛电脑的回答: