.net - how to prevent user controls code behind running in async postbacks? -


i have aspx page contains dozens of custom controls issue have asp.net ajax update panel update small area of page other user controls lives in page.(user controls outside update panel , update panel has updatemode="conditional") there way of programatically prevent running code behind of custom controls, since seriosly degrade performace/page load time. have check isasyncpostback script manager prevent unnecessary calls dal. there way prevent running custom control code behind according following conditions,

  • cannot touch custom control code behind,ascx page file etc
  • cannot use caching
  • any change can done aspx page , code behind referring above.
  • cannot integrate jquery or javascript frameworks(wish could) late now.

slightly off-topic, have freedom explore methods not include use of updatepanel? known have poor performance , should used sparingly.

with said, page lifecycle methods usercontrols must fire them rendered again. updatepanel methodology isn't expect "ajax" solution, because technically when updatepanel updates entire page re-rendered, parts asked change returned , redrawn in ui.

what might able check if you're in middle of ajax postback via:

scriptmanager.isinasyncpostback 

then can prevent code running in usercontrol's methods if property evaluates true.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -