Saw bearrui (AK-47) brothers of High Performance Web Development (11)-flush let the page block, gradually present, found that is an example of using JSP. I didn't understand how to do this in Asp.net. I checked it from msdn and found this thing response. Flush ().
The sameCodePost it
< Div ID = "Head" Style = "Border: 1px solid # CCC ;" >
Cnblogs logo < IMG SRC = "Http://home.cnblogs.com/images/logo_cnblogs_sns.gif" />
</ Div >
< BR />
< Div ID = "Content" Style = "Border: 1px solid blue ;" >
<%
// Sleep for 3 seconds
Thread. Sleep ( 3000 );
%>
Csdn logo < BR />
< IMG SRC = "Http://csdnimg.cn/www/images/csdnindex_piclogo.gif" />
</ Div >
In this case, the page is blank after 3 seconds.
Then add response. Flush ()
< Div ID = "Head" Style = "Border: 1px solid # CCC ;" >
Cnblogs logo < IMG SRC = "Http://home.cnblogs.com/images/logo_cnblogs_sns.gif" />
</ Div >
<%
Response. Flush (); // Flush response, multipart output
%>
< BR />
< Div ID = "Content" Style = "Border: 1px solid blue ;" >
<%
// Sleep for 3 seconds
Thread. Sleep ( 3000 );
%>
Csdn logo < BR />
< IMG SRC = "Http://csdnimg.cn/www/images/csdnindex_piclogo.gif" />
</ Div >
In this way, the above logo is displayed first and then sleep appears for 3 seconds. Haha, I learned how to output it in blocks, which is quite simple.
I'm stupid! I found out that some of my blog's comments mentioned that response. Flush () can be used. I have to work hard to check the comments for a long time without using msdn.