Spread ASP.NET 6.0 Product Documentation
Limiting Postbacks When Updating Bound Data
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Developer's Guide > Managing Data Binding > Limiting Postbacks When Updating Bound Data

Glossary Item Box

If your data set is getting lost when you click the Update button, make sure that you have code in your page load event so that you only re-create the bound data when you are loading for the first time and not overwriting it on each post back.

Return to the overview Managing Data Binding.

Using Code

Use the IsPostBack property.

Example

In this example, the if-endif structure surrounding the DataBind method restricts the method from being run on each post back.

C# Copy Code
if !(Page.IsPostBack)
    {
        ... other code ...
        FpSpread1.DataBind();
     }
VB Copy Code
If Not Page.IsPostBack Then
        ... other code ...
        FpSpread1.DataBind()
End If
© 2002-2012 GrapeCity, Inc. All Rights Reserved.