Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone tell me what is a PostBack ?
Please try to explain it with an example...

Thanks
Akiii
Posted

All Here
I hope the above information will be helpful. If you have more concerns, please let me know.
 
Share this answer
 
Comments
Akiii123 4-Apr-11 3:40am    
yes it has cleared my concepts.....Thank you very much for the help.....

Akiii
The page exposes the IsPostBack property. This is a read-only Boolean property that indicates if the page or control is being loaded for the first time, or if it is being loaded in response to a client postback. Many expensive operations (such as getting data from a database or populating ListItems) must be performed only the first time the page or control is loaded. If the page is posted to the server and then reloaded, there is no need to repeat the operation. By testing the value of IsPostBack, you can skip the expensive operation, as in the code snippets in Example 1 and Example 2.

Example 1. Testing for IsPostBack in VB.NET
VB
sub Page_Load(ByVal Sender as Object, _
              ByVal e as EventArgs)
   if not IsPostBack then
      '  Do the expensive operations only the
      '  first time the page is loaded.
   end if
end sub
Example 2. Testing for IsPostBack in C#
void Page_Load(Object sender, EventArgs e)
{
   if (! IsPostBack)
   {
      //  Do the expensive operations only the
      //  first time the page is loaded.
   }
}

try this link - [^]
 
Share this answer
 
v2
Comments
Akiii123 4-Apr-11 3:39am    
Excellent article and it cleared my concept.....Thank you very much.....much appreciated !!!

Thanks and Regards
Akiii
Check out msdn[^] - you should get some useful information on there.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900