WebButton provides two postback mode to be used, which are FlyPostBack and FullPostBack.
This topic will show you how to use FlyPostBack and standard PostBack mode.
To use FlyPostBack
- Right-click on WebButton control and choose Properties.
- Set PostBackMode to FlyPostBack and AutoPostBack to True.
- Put the following code in Clicked server-side event.
C#
Copy Codeprotected void WebButton1_Clicked(object sender, ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs e) { if (WebButton1.IsFlyPostBack) { Label1.Text = "Fly PostBack has occured, there should be a javascript alert "; WebButton1.ClientAction.Alert("Fly Postback"); WebButton1.ClientAction.RefreshModifiedControls(); } }
- Run the project. When you click the button, it will show an alert since it is in FlyPostBack mode.
To use FullPostBack
- Right-click on WebButton control and choose Properties.
- Set PostBackMode to FullPostBack and AutoPostBack to True.
- Put the following code in Clicked server-side event.
C#
Copy Codeprotected void WebButton1_Clicked(object sender, ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs e) { WebButton1.Text = "Full PostBack"; }
- Run the project. When you click the button, it will perform FullPostBack and the button's label will be changed to Full PostBack.