Solve the problem of font size after page refresh in C #

Source: Internet
Author: User

Source: http://blog.csdn.net/wcsjsdn/article/details/5109605

We often encounter a problem in. NET development, that is, when you click on a button, call the JS statement, when you click "OK", you will find that the page's CSS style sheet is missing, the page frame is not normal.

Then, we use what kind of code can let him have both JS effect statement, and do not affect the basic frame of the page, this sentence needs to use the knowledge of page registration: RegisterClientScriptBlock or RegisterStartupScript, these two effects, The only difference is: from "where" to send the script block, that is, after the run of his in the HTML display in the location, this can be viewed on the internet, below, I still use his example, specifically write down their use of the two:

protected void Button1_Click (object sender, EventArgs e)
{

Page.ClientScript.RegisterClientScriptBlock (this. GetType (), "name", "<script>alert (' current shopping cart, no goods ');</script>");

Or:

Page.ClientScript.RegisterStartupScript (this. GetType (), "name", "<script>document.location=document.location; </script> ");
}

The "name" parameter is of no obvious use.

Solve the problem of font size after page refresh in C #

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.