What is IsPostBack in Asp.net
IsPostBack is a Boolean type property of Page class, which indicates whether the page is being loaded for the first time or not! IsPostBack is always false by default.
You need to understand two things about the isPostBack in Asp.net
IsPostBack property helps avoiding unnecessary database call every time page gets loaded, thus adds value in application performance improvement.
Let me give you an example, just assume you are working on a page with student data using a GridView
, and on page you want to provide a functionality for updating every single row, in row there is field of “Subject List” displayed in a dropdown.
Now every time , one student data updated and loaded again, the subject list remain same, which you don’t need to fetch from database , in this situation you can put the subject list load method inside isPostBack clause.