The style changes after the Asp.net page is refreshed.

Source: Internet
Author: User

 

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
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.