Recently, I made a project using CSS to control the style. I found that the style changed after response. Write was used, and the position and body were incorrect. Response. this is also true for write ("<SCRIPT> alert (') </SCRIPT>"), which is not found in section 2003 and is hard to understand, I happen to have seen a post on csdn discussing this issue. The reasons are as follows:
Default use in ASP. NET 2.0 <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> document definition model, the rules of this DTD are different from those of the previous, therefore, many previously writtenCodeIt cannot run properly under the new standard.
-----------------------------------------------
Response. Write indicates that data is written at the point of course-output stream.
In ASP. NET, do not randomly use response. Write, which will disrupt the output stream order of ASP. NET.
The output using response. Write in. aspx. CS will appear at the top of the page
The expected page layout will fail.
-------------------------------------------------
Normally, do not use response. Write. it will disrupt your object-oriented model.
------------------------------------------------
Use this instead:
Page. clientscript. registerstartupscript (this. GetType (), "alert", "<SCRIPT> alert ('messagebox effect'); </SCRIPT> ");
Post-Statement: As div is a stream layout, response. the write () Output content is always at the front of the page, breaking the original stream layout, which may cause style changes. However, it is still unclear why the font will change.