Limitations of refreshing a New View

Source: Internet
Author: User

In my post on "No refreshing" page Jump ", I proposed an idea of how to achieve a no refreshing page Jump, and used the updatepanel to dynamically load usercontrol (called a view). Through this period of time, we can see from the implementation results that it is quite satisfactory. During the conversion of each view (usercontrol), the page will not be refreshed, which can greatly improve the user experience friendliness. At the same time, because the refresh is not rerefreshed, the resource files such as GIF, CSS, and JS that were originally requested each time will not be reloaded during each view conversion, this can undoubtedly reduce server resource consumption and improve server throughput. This is also the expected result, but I have to admit that there are also many defects in doing so:

First, because it depends on the updatepanel control of Atlas, some shortcomings of updatepanel have become its biggest limitation. For example, in updatepanel, you cannot directly use fileupdate to upload files. It may conflict with other third controls and UI development kits. There are also some bugs that may cause us some difficulties. But in general, these problems can be completely solved through some workarounds. Fortunately, more and more third controls are trying to adapt to Atlas and make some changes. Using updatepanel at the same time can avoid repeated Page Submission issues (when a page executes a PostBack event, refresh the page again and you will be prompted whether to retry. If yes, but on the other hand, you must be familiar with the page execution mechanism of updatepanel. In fact, it is still a PostBack event, and if you view the ispostback of the page, its value is still true. In addition, it fully complies with the PostBack execution process of a common page, and none of the execution events are missed. The only difference is that some execution results may not be fed back to the page, because it is not included in the updatepanel to be updated, their viewstate value has changed.

Second, because the view does not load the JS file again, some views may not be correctly loaded in Dynamically Loaded JS files. This problem occurs when you use the atlascontroltoolkit. In this case, you can pre-load it on the page. If it is a separate JS file, you can use page. clientscript. registerclientscriptinclude to register the included JS file. You can also use similar client script interfaces to register different forms of scripts.CodeBlock.

Finally, view redirection occurs in the navigation control's PostBack event. We all know that when the page is PostBack, it will submit the current viewstate of the page to the server. At this time, every time a view jump occurs, the viewstate of the page will actually be uploaded to the server. After the server completes processing again, it will go to the new view to achieve the view jump. For example, if the size of viewstate on the current page is 50 Kb from view a to view B, you must first pass the page of 50 kb to the server, restore the viewstate, and then load the new view, generate the viewstate of the new view and return it to the client. For normal pages, page Jump (request) generally does not need to pass the original page to the server, restore viewstate and other steps. Generally, its request is only dozens of times, hundreds of bytes (unless the page Jump occurs in the PostBack event, use response on the server side. ). In the face of this situation, if the network environment permits, there is no problem at all. Or we can completely disable the viewstate of the page. This is the best solution, which can be greatly improved.ProgramBut without viewstate, you need to have a deep technical skills and more careful programming habits.

the above is a summary of some problems encountered so far. In the future, we may encounter other different situations. We believe they can all be solved by some means. Since no one has ever practiced it before, we can gain a deeper understanding of all aspects of Asp.net. In addition, through recent new contacts with IFRAME, such as the modaldialog effect simulated by the framework by submodal, back button support for Atlas updatepanels can simulate backward/forward in updatapanel through the framework, bookmark functions. There is a new idea, is it possible to use dynamic IFRAME to achieve such a refreshing new view (PAGE) jump, or is Gmail implemented like this? Just conjecture.

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.