Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's the purpose of IsPostBack?

Status
Not open for further replies.

TheBugSlayer

Programmer
Sep 22, 2002
887
US
Hi all.
I have been trying to understand the purpopse of IsPostBack function for sometime now and I haven't been able to come up with a convincing explanation.

Can someone explain it to me? When the condition is checked in the Page_Load event, what is it for?

Any help is appreciated.
 
John's explanation is perfect. Typically, you would use this kind of thing in the page_load event

If not page.ispostback then
.. do some databinding or initial page set up here
end if

The reason being that the initial page processing is persisted across subsequent postbacks by the viewstate, so there is no need to do it again.

Hope this helps

Mark [openup]
 
Thank you. I understand better now. I played around with it and it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top