When developing web applications using ASP.NET, pop-up dialog boxes are often used. Generally, I write them like this
Response.Write("","<script>alert('Pop-up window!');</script>");
But one problem with writing this way is that when the dialog box pops up, the entire page is white, and the progress bar is moving slowly. It will be fine when you click OK. Why is this?
This is how I understand it. The program is executed sequentially. When the above statement is executed, the program begins to wait for the user's operation, and then continues execution. I didn't pay attention at first, but the more I looked at it, the more ugly it became. What do you think? I also had to change it so that when it pops up, the webpage still has content. Later, the teacher told me that I can use the following method.
Page.RegisterStartupScript("","<script>alert('Pop-up window!');</script>");
That's it!
http://www.cnblogs.com/interboy/archive/2006/08/02/466143.html