ImageButton temp_dele = (ImageButton)e.Row.FindControl("lb_del");
temp_dele.CommandName = "TrainRecord_Dele";
temp_dele.CommandArgument = e.Row.RowIndex.ToString();
temp_dele.Attributes.Add("onclick", "return confirm('真的删除吗?');");
你们怎么知道attrubutes.Add()括号内的内容是那样写的? 哪些控件有Attribute成员。 凭什么 Attribute.Add就可以弹出提示信息。是固定用法吗?
temp_dele.CommandName = "TrainRecord_Dele";
temp_dele.CommandArgument = e.Row.RowIndex.ToString();
temp_dele.Attributes.Add("onclick", "return confirm('真的删除吗?');");
你们怎么知道attrubutes.Add()括号内的内容是那样写的? 哪些控件有Attribute成员。 凭什么 Attribute.Add就可以弹出提示信息。是固定用法吗?
Add 添加属性Attributes.Add("name", "控件name属性值")
Attributes.Add("onclick", "alert('点击事件发生')")
最后在浏览器中实际得到的是HTML+JS。