8 个解决方案
#2
Response.WriteLine("<script>alert('hello')</script>");
#3
OnClientClick="javascript:return confirm('Are you sure?');"
#4
网页就找网页的调用方法,不要去找winform的调用方法
#5
你都说是网页了,还去找Messagebox干嘛 网页就用alert,confirm
#6
<script type="text/javascript">
$(function () {
$.messager.confirm("操作提示", "您确定要执行操作吗?", function (data) {
if (data) {
alert("确定");
}
else {
alert("取消");
}
});
});
</script>
#7
下面两种都可以
btnDelete.Attributes.Add("Onclick", "javascript:return confirm('您真的要删除吗?');");
btnDelete.OnClientClick = "javascript:return confirm('您真的要删除吗?');";
btnDelete.Attributes.Add("Onclick", "javascript:return confirm('您真的要删除吗?');");
btnDelete.OnClientClick = "javascript:return confirm('您真的要删除吗?');";
#8
ASP.net MVC (Razor)
<input type="submit" value="Delete" class="btn btn-warning btn-md" onclick="return confirm('Are you sure to delete this record?')" formaction="@Url.Action("Delete", new { userId = Model.UserId })" />
#1
#2
Response.WriteLine("<script>alert('hello')</script>");
#3
OnClientClick="javascript:return confirm('Are you sure?');"
#4
网页就找网页的调用方法,不要去找winform的调用方法
#5
你都说是网页了,还去找Messagebox干嘛 网页就用alert,confirm
#6
<script type="text/javascript">
$(function () {
$.messager.confirm("操作提示", "您确定要执行操作吗?", function (data) {
if (data) {
alert("确定");
}
else {
alert("取消");
}
});
});
</script>
#7
下面两种都可以
btnDelete.Attributes.Add("Onclick", "javascript:return confirm('您真的要删除吗?');");
btnDelete.OnClientClick = "javascript:return confirm('您真的要删除吗?');";
btnDelete.Attributes.Add("Onclick", "javascript:return confirm('您真的要删除吗?');");
btnDelete.OnClientClick = "javascript:return confirm('您真的要删除吗?');";
#8
ASP.net MVC (Razor)
<input type="submit" value="Delete" class="btn btn-warning btn-md" onclick="return confirm('Are you sure to delete this record?')" formaction="@Url.Action("Delete", new { userId = Model.UserId })" />