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 #