方法一:
1.在InitializeComponent中添加句柄
private void InitializeComponent()
{
this.Button1.PreRender += new System.EventHandler(this.Button1_PreRender);

}
2.加入句柄响应
private void Button1_PreRender(object sender, System.EventArgs e)
{
this.Button1.Attributes.Add("onclick","return confirm('确定要删除吗?');");
}
方法二:
this.LinkButton.Attributes.Add("OnClick","javascript:return confirm('您确定要删除吗?')")
1.在InitializeComponent中添加句柄
private void InitializeComponent()
{
this.Button1.PreRender += new System.EventHandler(this.Button1_PreRender);
}
2.加入句柄响应
private void Button1_PreRender(object sender, System.EventArgs e)
{
this.Button1.Attributes.Add("onclick","return confirm('确定要删除吗?');");
}方法二:
this.LinkButton.Attributes.Add("OnClick","javascript:return confirm('您确定要删除吗?')")

浙公网安备 33010602011771号