[英]Show Alert message on button click after saving the data asp.net
I want to show a message "Successfully added" after saving the record to the database on button click which already having a JS function for some validation on the data. 我想在按钮单击上将记录保存到数据库之后显示消息“成功添加”,该按钮单击已经具有JS功能以对数据进行一些验证。 i have tried the following code but nothing is showing. 我尝试了以下代码,但没有显示任何内容。
ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert",
"<script>alert('" + "Successfully added" + "');</script>", false);
How to show the success message in a popup with at the end save process? 如何在结束保存过程中在弹出窗口中显示成功消息?
Use Response.Write("<script>alert('Successfully added');</script>");
使用Response.Write("<script>alert('Successfully added');</script>");
on button code behind. 在按钮代码后面。
尝试这个,
System.Web.HttpContext.Current.Response.Write("<script language=\"JavaScript\">alert(\"write here what you want\")</script>");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.