来自: http://forums.asp.net/t/1182575.aspx

I feel I should share my recent experiences on this rather common challenge, for the sake of others who inevitably will face the same problems. I am actually rather surprised that some of more experienced gurus of this forum did not react - probably they have not seen the posts ( Huh? ?).

Well, my initial problem originated, as usual, from my own ignorance.

Searching for the most effective way to display a complex Web page, something that may go into tens of seconds over a slow dial-up connection, in increments so that the users gets first parts relatively fast and they get something to do while the rest of the page is loaded, I implemented the incremental Page Display from the AJAX samples (#28, by Joe S.). As my test revealed, that simple textual part, the beginning of my page, which I sent in through the Web service (as the exampole goes) came in actually slower than the rest of the page. It came distinctly at a different time (I have a fast cable connection and a very fast development PC, but the difference in time was still obvious), but after the rest of the page was loaded. It was an eye-opening experience.

1) If I was to use that Incremental Page Display example, I should use the Web Service approach to send in the slowest parts, the complex graphics and similar.

2) The second conclusion is for me far more interesting. It has nothing to do with the Web Service approach. I actually noticed that parts of the complex page have come up on the client (IE7 browser) screen at distinct times, and not in the physical sequence as the page is written, but as they obviously became ready. That was exactly what I needed!

My initial page design (just laugh, it is OK! I am learning...) used tables, actually one large table, to position the elements on the page as required. I have seen that from many examples, and even now on the Web there are many, many cases like that, probably the majority. Obviously, the page did not display until the table was formated by the browser. So, it was sloooow...

Then I discovered that some authors are recommending DIVs. Initially it seemed more complex, and I did not have the logic that would explain why... Until my test.

Also, the documentation describes the server side page preparation by IIS as buffered by default, meaning it prepares the complete page before it sends it out. I contemplated experimenting with declaring selected pages as un-buffered, but did not get that far to actually try that interesting idea (maybe someone wishes to comment?)...

But what I had done in re-writing my page was to restructure it into DIVs. And now I saw it at the client screen that these DIVs are displayed as they get formated by the browser, popping all over the screen in the inverse order of their complexity.

That means that I can display any page in parts by just organising it into DIVs.

And that is all I need. Perfect.

To me, it is an important experience.

I would love to read somewhere in the documentation anything explicit on this DIV and page rendering process. If anyone reading these lines would have a link, or a suggestion where to start with this type of research, I'd be grateful.

So, I just thought someone else might benefit from reading about this experience...

Cheers...

Posted on 2008-05-23 11:31  trywebservice  阅读(321)  评论(0编辑  收藏  举报