如何在 ASP.NET 中显示来自 C# 的警报框? [英] How to display an alert box from C# in ASP.NET?

查看:22
本文介绍了如何在 ASP.NET 中显示来自 C# 的警报框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 detail-view 并希望在我的代码块末尾显示一个警告框,上面写着:

I am using a detail-view and would like to display an alert-box at the end of my code block that says:

谢谢!您的数据已成功插入.

Thank you! Your data has been inserted successfully.

是否有一种简单的方法可以从我的 ASP.NET 网页背后的 C# 代码中做到这一点?

Is there a simple way to do this from the C# code behind of my ASP.NET web pages?

推荐答案

插入代码后,

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);

这篇关于如何在 ASP.NET 中显示来自 C# 的警报框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆