几种:
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from text box!!');"
Button1.Attributes.Add("onclick", "return confirm('您刚刚更改的数据还未保存上传,是否继续?');")
代码加入Page_Load中.
OR DataGrid <asp:ButtonColumn text=” <div onclick='javascript:return confirm("Are you sure to delete this record?");'>Delete</div>” >