Difference between AutoPostBack=True and AutoPostBack=False?

后端 未结 10 1949
广开言路
广开言路 2020-12-01 09:07

What\'s the difference between AutoPostBack=True and AutoPostBack=False?

10条回答
  •  余生分开走
    2020-12-01 09:26

    Taken from http://www.dotnetspider.com/resources/189-AutoPostBack-What-How-works.aspx:

    Autopostback is the mechanism by which the page will be posted back to the server automatically based on some events in the web controls. In some of the web controls, the property called auto post back, if set to true, will send the request to the server when an event happens in the control.

    Whenever we set the autopostback attribute to true on any of the controls, the .NET framework will automatically insert a few lines of code into the HTML generated to implement this functionality.

    1. A JavaScript method with name __doPostBack (eventtarget, eventargument)
    2. Two hidden variables with name __EVENTTARGET and __EVENTARGUMENT
    3. OnChange JavaScript event to the control

提交回复
热议问题