Geeth
Geeth

Reputation: 5343

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. 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?

Upvotes: 2

Views: 23143

Answers (2)

relower
relower

Reputation: 1313

try this,

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

Upvotes: 2

Romil Kumar Jain
Romil Kumar Jain

Reputation: 20745

Use Response.Write("<script>alert('Successfully added');</script>"); on button code behind.

Upvotes: 6

Related Questions