Asynchronous and synchronous postback in ASP.NET

后端 未结 4 1017
清歌不尽
清歌不尽 2020-12-10 08:05

What are the differences between asynchronous and synchronous postback?

4条回答
  •  [愿得一人]
    2020-12-10 08:21

    The synchronous postback uploads your html in the request back to the server so that the server can remember the data viewstate of the page so it allow you to get the information from the input fields entered by the user and it require that the page get refreshed.

    The asynchronous postback, allow you to call a specific function on the server and the response of the server can be json, xml or html and then you parse this response and respond to it using javascript which allow you to enhance the user experience as the page doesn't refresh and it doesn't take to much time to call the method and get the response as it doesn't require uploading the html in the request.

提交回复
热议问题