簡體   English   中英

保存數據asp.net后,在按鈕單擊時顯示警報消息

[英]Show Alert message on button click after saving the data asp.net

我想在按鈕單擊上將記錄保存到數據庫之后顯示消息“成功添加”,該按鈕單擊已經具有JS功能以對數據進行一些驗證。 我嘗試了以下代碼,但沒有顯示任何內容。

ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert",
"<script>alert('" + "Successfully added" + "');</script>", false);

如何在結束保存過程中在彈出窗口中顯示成功消息?

使用Response.Write("<script>alert('Successfully added');</script>"); 在按鈕代碼后面。

嘗試這個,

System.Web.HttpContext.Current.Response.Write("<script language=\"JavaScript\">alert(\"write here what you want\")</script>");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM