The update panel is very slow

I am writing an application in which a user can register. When registering, you can select several options, and according to these fields the registers are visible or not, and they are required or not. I came up with the idea that all fields will be included in updatePanel, and when users change the registration settings, I would set the visibility of these fields on the server side.

It works, but incredibly slowly, and more on FF, I have this error:

Status information is invalid for this page and may be corrupted

3 checkboxes with other fields are in updatePanel

Each field is in the dl tag with runat="server>

I had to do this as this reason for the “required” option. I just add the css class to this dl (needed in javascript validation. If the field should be visible, I set visible = "false" for the given dl, and then this field for example FirstName with a heading, etc., is not visible after the postback .

Am I doing something wrong? Why it takes so much time (~ 4 minutes on localhost), and it really doesn't work in firefox (when I use debug, I think the process ends without errors on ff, I don’t understand this at all :)

If the update panel is so weak that it will be another option to change the visibility and add the necessary class for all dls. The logic is quite complex and should make a query to the database, so simple javascript will be quite complicated.

Thanks for any tips,

Oh, and I use ASP.Net and cannot update this project.

Thanks for the help, goodbye

+4
source share
4 answers

Without code to look, here are the general things that slow UpdatePanel:

  • A lot of form data will be published (e.g. Viewstate). Downloaded data is often slower than downloading data (depending on the type of connection, for example, a home connection, where downloading can be 5 times slower than downloading). Even if you do not see this, each form field on the page is sent back to the server (even if it is not in UpdatePanel).

I would suggest looking at your request / response data in Firebug and making sure that your asynchronous requests are less than 5K and your responses no more than 20K.

  • A slow process on the server that starts when UpdatePanel is published. How does your code execute when uninstalling UpdatePanel?

  • JavaScript errors (yours and Microsoft's). Here is a link to a known bug and fix that I used myself: http://support.microsoft.com/?kbid=2000262

  • Massive DOM manipulation (it seems this is not the case).

BTW, looking for the error message you are reporting gives you many possible reasons: http://www.google.com/search?aq=f&sourceid=chrome&ie=UTF-8&q=The+state+information+is+invalid+for + this + page + and + might + be + corrupted

As always, minimizing or removing dependencies on ViewState ... is the source of many problems and allows you to make poor design decisions.

+4
source

You need to set the mode of updating the properties of the Conditional update panel instead of Always . Limit the number of controls placed in one update pane.

+1
source

You might want to check page events, etc. Examining the AutoEventWireup Page Guide and Page Properties Since performance is a problem that you have identified, you can also check this. The update panel mode must be conditional. Check also triggers

0
source

Try with these property values ​​in Page directive . This is always at the top of the page. Let other properties be what they were before. Update panels should not be slow as you report.

  <%@ Page ViewStateEncryptionMode="Never" EnableViewStateMac="false" EnableEventValidation="false" %> 

I would also like to add that if your query to the database you mentioned is complex, it takes a lot of time, then the problem is not in the ASPX page or update panel, but in the database query. Then you will need to profile your request and check how long it takes to execute. In this case, you can fine-tune your query at the database level.

0
source

Source: https://habr.com/ru/post/1344428/


All Articles