李献计:关于JS中Attributes.Add
红牛电脑的回答:
foreach (Control var in Page.Controls) { if (var is Button) { string btnId = Page.ClientID; if (Regex.IsMatch(btnId, @"^btn\d+$", 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, @"^btn\d+$", RegexOptions.IgnoreCase)) { (var as Button).Attributes.Add("onclick", "xxx"); } } }
经验分享互联网动态
更多阅读推荐