We encounter this problem during project reference:
When a page is loaded, a style is displayed. When some client or server methods are called, the style of the page changes.
If the page style is not rewritten through a program, it may be that after some methods are executed, an error occurs when the code of the entire page is used. if the JS prompts response. after writing, this method outputs the output content to the front of the entire page. make the page error outside the <HTML> tag.
How can this problem be solved?
/// <Summary>
/// A small JavaScript window is displayed.
/// </Summary>
/// <Param name = "JS"> window Information </param>
Public static void alert (string message, page)
{
# Region
String JS = @ "<script language = 'javascript '>
Alert ('"+ message +"'); </SCRIPT> ";
If (! Page. clientscript. isstartupscriptregistered (page. GetType (), "alert "))
{
Page. clientscript. registerstartupscript (page. GetType (), "alert", JS );
}
# Endregion
}