Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display an alert box from C# in ASP.NET?

Tags:

c#

asp.net

alert

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.

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

like image 369
moe Avatar asked May 04 '13 04:05

moe


People also ask

How do I display text in alert box?

The Window alert() method is used to display an alert box. It displays a specified message along with an OK button and is generally used to make sure that the information comes through the user. It returns a string which represents the text to display in the alert box.

Which function takes the text and displays it in an alert box?

Use the alert() function to display a message to the user that requires their attention. This alert box will have the OK button to close the alert box. The alert() function takes a paramter of any type e.g., string, number, boolean etc.


1 Answers

After insertion code,

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true); 
like image 162
Mudassir Hasan Avatar answered Sep 23 '22 00:09

Mudassir Hasan