Click here to Skip to main content
15,396,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to create a pop up window on button click to notify user to smth??
for example.. when user will click the save button.. i want a pop window to notify him that the changes were saved
Posted
Comments
Jibesh 20-Dec-12 7:04am
   
windows form? or Web?

If windows form:
C#
private void button1_Click(object sender, EventArgs e)
        {
        Messagebox.Show("Changes saved");
        }


if webform:

HTML
<!DOCTYPE html>
<html>
 <head>
 <script>
 function myFunction()
 {
 alert("Changes saved!");
 }
 </script>
 </head>
 <body>

 <input type="button" onclick="myFunction()" value="Show alert box">

 </body>
 </html>
   
v2
Use Following Code :

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert('Data Saved Successfully!!')", true);
   
v2
For that you can use AJAX Modal Popup Control (I hope you are aware about this) :
Dynamic AJAX Modal Popup[^]
Modal Popup Overlay[^]
   
Comments
David Goebet 20-Dec-12 7:02am
   
What about a normal MsgBox (MessageBox) ?
[no name] 20-Dec-12 7:04am
   
Yes you can use it as well..
Ankur\m/ 20-Dec-12 7:30am
   
Why ajax popup box? Just an alert will do the job.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900