Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
What is the use of PostBack function in C#?
Posted
Updated 13-Nov-10 0:52am
Comments
Sandesh M Patil 13-Nov-10 6:57am    
Are you talking IsPostBack method?

When asp.net page is being loaded first time it renders all its content and waits for your future actions.
If you submit this form to itself (by clicking on the form submit button for example) the browser posts back to the page.
In ASP.NET the post back can be tracked, evaluated, and processed.


Basically in order to post back you must submit the page to itself.
If you just click a link with the page URL it is not posting back, it is reloading the page.

There are tons of articles on the web how to handle the PostBack
Good luck
 
Share this answer
 
Comments
raju melveetilpurayil 14-Nov-10 4:56am    
good one
Have a look at ASP.Net page object model here[^].
 
Share this answer
 
PostBack function allows users to use information coming from the server
after a request to the server!
 
Share this answer
 
Gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
[Visual Basic, C#, JScript] The following example tests the value of the IsPostBack property to conditionally call the Page.Validate method for all validation server controls when the Page is loaded.

[Visual Basic]
VB
Sub Page_Load
    If Not IsPostBack
        ' Validate initially to force the asterisks
' to appear before the first roundtrip.
        Validate()
    End If
End Sub

[C#]
C#
void Page_Load() {
    if (!IsPostBack) {
        // Validate initially to force asterisks
// to appear before the first roundtrip.
        Validate();
    }
}

[JScript]
JavaScript
function Page_Load() {
    if (!IsPostBack) {
        // Validate initially to force the asterisks
// to appear before the first roundtrip.
        Validate();
    }
}
 
Share this answer
 
v2
Comments
Henry Minute 18-Nov-10 11:06am    
If you must trawl through old questions to add answers in order to gain points and then just copy from the MSDN page, you would save yourself a load of time if you just link to the page.

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