Free Web Development Online Tutorials, Learn to Code
Learn Asp.net Aspx, Free Asp.net Tutorial in C#, Asp.net Web Application Development Guide

IsPostBack in Asp.net Application

What is IsPostBack in Asp.net

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 asp.net

You need to understand two things about the isPostBack in Asp.net

Use of IsPostBack property 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.

if(!IsPostBack)
{
    LoadSubjectList();
}

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

Comment
Name
Email
Website
Subscribe
 
Use isPostBack in Asp.Net