Pop up the dialog while keeping the page display

xiaoxiao2021-03-17  193

In many websites, you will often see the problem with the background code pop-up dialog. The commonly used solution is to pop up the dialog through JavaScript, which is a blank when the page pops up the dialog box. What is described here is how to pop up the display while the dialog is popped up.

[Principle] Place a hidden control on the page and put a script code on the page, the script code detects the value of the hidden control is empty, if not display the information, otherwise, nothing. The background code modifies the value of the hidden control when needed, so that the last script code will execute and pop up when the page passes to the user. [Precautions] 1. The hidden control must be an HTML control, otherwise JavaScript cannot be found. 2. Background code To modify the value of the hidden control, the hidden control naturally adds the runat = "server" tag. 3. After the pop-up dialog box, remember to blank the Value of the Hidden Control, otherwise it will play again when refreshed. 4. The script code must be placed behind the hidden control, otherwise it will not be found. [Implementation] page code (only list related code)

// Add a hidden control

// JavaScript code