Last post Oct 05, 2016 02:29 PM by Sandeep Apsingekar
Oct 04, 2016 11:00 PM|Sandeep Apsingekar|LINK
I would like to know what is the main use of isPostBack in asp.net. What is the need for a page to know whether it is loaded for the 1st time or it was loaded on button click. I tried enabling post back in drop down list and I see that whenever I select
some values in the drop down the page loads.
Any simple explanation would appreciated.
Oct 05, 2016 01:20 AM|Sumit.Pokhriyal|LINK
When the page is loaded first time IsPostBack = false and when an event takes place (such as button click) it means IsPostBack=true
Simple example of what to do in !page.IsPostBack, is to populate controls on the initial load such as binding dropdown list, so you need to put all your databinding code in the !page.IsPostBack. The values are saved in the viewstate and
can be read by the form if it gets posted back to itself.
You can also check below links:
Oct 05, 2016 02:29 PM|Sandeep Apsingekar|LINK
Thank You, this explanation is helpful.