IsPostBack c# example

What is IsPostBack in!, how does it help in real-time application development!

What is page.ispostback in

Page.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.

ispostback in

You need to understand two things about the isPostBack in

Use of IsPostBack property in

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.


This is how Page.isPostBack property used in page development for loading data.

Asp.Net C# Examples | Join Asp.Net Course | Learn MVC | Core Tutorial