Background to judge, similar to the login need popup box, if directly through the Response.Write write <script> code will cause a blank page popup an alert, is through write to send the output to the server side, If you want to enter the Window.onload method can be used normally but alert will have a blank page in the middle of only one alert display, background write more recommended Scriptmanager.registerstartupscript (this. Page, this. GetType (), "Onekey", "Alert (' Login failed ')", true);
The first parameter is the control ID of the script you want to register, try it, as long as this page is on the line.
The second parameter is the registration script control type, either the GetType () of the control or this, and typeOf (string) is fine.
The name of the third script function, randomly.
The fourth one is the script content.
The fifth one is to indicate whether to add the script tag again, if the fourth parameter contains the <script></script> tag, false here, otherwise true.
When the style adjustment encountered such a problem background CSS can not adjust the foreground style, and later found that because the ordinary control plus runnat= "service" reason, He will add a ContentPlaceHolder prefix to the control ID, causing the original ID to not find the control that needs to be adjusted, so you can avoid non-server control add Runatservice or go to the foreground to find his real ID.
. NET programming first-time project income