sd_*_*ula 1 c# asp.net popup button
我需要在删除按钮中添加一个"你确定"的弹出窗口,我不知道如何确定用户是单击确定还是取消.
我是这样做的:
string message = "Are you sure you want to delete this user?";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("return confirm('");
sb.Append(message);
sb.Append("');");
Type type = this.GetType();
ClientScript.RegisterOnSubmitStatement(type, "alert", sb.ToString());
Run Code Online (Sandbox Code Playgroud)
你可以在按钮上设置OnClientClick:
return confirm("Are you sure you want to delete this user?");
Run Code Online (Sandbox Code Playgroud)
如果用户没有单击"确定",则不会发生提交/回发.
| 归档时间: |
|
| 查看次数: |
17776 次 |
| 最近记录: |