Ajax Async Process Flow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prit
    New Member
    • Jun 2007
    • 4

    Ajax Async Process Flow

    As we know ajax resides between server and client and helps the page's partial rendering...so no need to render all the page controls from scratch....so when we know that some controls requires post back data..we put those control in ajax "update panel" tags...and rest of the non postback enabled controls outside updte panel....

    Now we have 6 controls in a web form...2 of them dont need async process..and 4 of them need async process...so we put those 4 controls within a update panel..now these 4 controls requires rendering...rig ht ??

    But only one of the controls get changed...so my ques is - all 4 controls goes to server for re-rendering...or only 1 control whose data get changed goes to server for re-rendering ??? And if only 1 control (who is changed) goes to server ..then who renders rest 3 controls Ajax itself by any caching mechanism ..or all 4 controls in update panel goes to server and server async'ly render all 4 controls??
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Well the first thing that jumps out at me is that you are mistaken about Ajax. Ajax does not reside "between" the client and the server. Ajax exists in the browser...in the client. Ajax stands for Asynchronous JavaScript And XML. It is used to make an asynchronous request to the server.

    Ajax in ASP.NET is a not exactly as simple and clean as a pure Ajax request to the server. When you use the UpdatePanel to preform an Asynchronous request to the server, the entire page content (including the ViewState) is sent to the server so that the server can process the request. When the response is sent back to the browser it is stripped down to only contain the content that is needed to be displayed in the UpdatePanel.

    So, to answer your question:
    Originally posted by prit
    [do] all 4 controls goes to server for re-rendering
    Yes, all 4 controls (and everything else on the page) are sent to the server. These 4 controls are re-rendered in the browser when the response is sent back because they are within the UpdatePanel. The 2 controls that are outside of the UpdatePanel are not re-rendered because the response has been stripped down to only contain the content within the UpdatePanel that preformed the asynchronous request.


    -Frinny

    Comment

    • prit
      New Member
      • Jun 2007
      • 4

      #3
      ajax async process flow

      So you mean to say that all the controls within the update panel are re-rendered !!

      Let me remind you that, my situation was that 4 controls are in update panel and only 1 of them has been changed by its content, not the rest 3 controls within the update panel. Still those rest 3 controls are re-rendered from scratch with its corresponding data content??

      Then why by using AJAX it takes less time or flicker so less?? It seems to me that only difference between conventional ASP.net and AJAX ASP.net is that - in AJAX ASP.net, browser only re-renders the controls within update panel.

      But why the controls which didnt change by its own content needs to be re-renered? Those controls can be populated with data by using any catching mechanism !! An only changed (by content) controls are re-renderd...

      Is this approach taken becoz the controls within upadate panel may be inter-dependent by their contents??

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        It sounds like you want to place each control into an UpdatePanel of their own.
        Anything within an UpdatePanel will be refreshed...thi s is just how things work.

        -Frinny

        Comment

        • prit
          New Member
          • Jun 2007
          • 4

          #5
          Thanks Frinny..It was really a quick response...

          Comment

          Working...