Below is aspxCode:
< Body >
< Form ID = " Form1 " Runat = " Server " >
< ASP: scriptmanager ID = " Scriptmanager1 " Runat = " Server " />
< Div >
< ASP: updatepanel ID = " Updatepanel1 " Runat = " Server " >
< Contenttemplate >
< ASP: timer ID = " Timer1 " Runat = " Server " Interval = " 5000 " Ontick = " Timerw.tick " >
</ ASP: Timer >
</ Contenttemplate >
</ ASP: updatepanel >
</ Div >
</ Form >
</ Body >
The following code is Aspx. CS:
Protected Void Timereffectick ( Object Sender, eventargs E)
{
Scriptmanager. registerclientscriptblock ( This . Updatepanel1, updatepanel1.gettype (), " Error " , " Window. showmodaldialog ('pop. aspx ', 'newwindow', 'dialogwidth: 400px; dialogheight = 300px; center: Yes; help: No; resizable: No; Status: no '); " , True );
// Scriptmanager. registerclientscriptblock (this. updatepanel1, updatepanel1.gettype (), "error", "window. open ('pop. aspx ', 'newwindow', 'height = 450, width = 550, Top = 120, Left = 250, toolbar = No, menubar = No, scrollbars = No, resizable = No, location = No, status = no'); ", true );
// Scriptmanager. registerstartupscript (updatepanel1, updatepanel1.gettype (), "", "alert ('prompt: product added successfully! '); If (confirm (' do you want to add more? Cancel going to product management page ') {alert ('add more on this page')} else {open ('productmanage. aspx ',' _ Self ');} ", true );
}
In Aspx. CS:
The first method is to use the showmodaldialog method to pop up the modal window.
The second method is to use window. Open to pop up the window.
The third method is to pop up the window, and execute different results for different confirmation examples.