Implementation of IsPostBack in page load

后端 未结 8 1029
你的背包
你的背包 2020-12-06 00:07

The more I use ASP.NET, the more if (!IsPostBack) {} seems pointless...

First example:

For example, I just Googled an issue, they said use this

8条回答
  •  执念已碎
    2020-12-06 01:00

    It's for processing form data.

    If you want to handle POSTed data, you only want to do so if the page actually posted data, not on first load. Hence, the IsPostBack flag.

提交回复
热议问题