WebFlyPostBackManager can be used to retrieve data or execute methods from two type of services.
- SOAP-based XML WebService Page
- WebForm Page (.aspx)
WebService
To request an execution of method from WebServices, change WebFlyPostManager's ServiceType property to WebService and specify its
ServiceURL.

With this settings you must have a .asmx file that points to WebService Class which WebFlyPostBackManager will refer to.
Later on at ClientSide, with WebFlyPostBackManager you can request an execution of method at WebService (e.g HelloWorld()) and retrieve its return value at
OnResponseSuccess event.
Note: The Method that is going to be executed must be marked with [WebMethod()]
WebServiceSamples.asmx
<%@ WebService Language="C#" CodeBehind="~/App_Code/WebServiceSamples.cs" Class="WebServiceSamples" %>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebServiceSamples : System.Web.Services.WebService {
public WebServiceSamples () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
}
<script language="javascript" type="text/javascript">
<!--
function OnClientClick(controlId, parameter)
{
var FPBMan = ISGetObject("WebFlyPostBackManager1");
FPBMan.HelloWorld();
return true;
}
function OnResponseSuccess(controlId, method, returnValue)
{
alert("The return value of HelloWorld method is: " + returnValue);
}
-->
</script>
WebForm
To request an execution of method from WebServices, change WebFlyPostManager's ServiceType property to WebService and specify its
ServiceURL.

With this settings you must have a .aspx file (WebForm) which has a listener (WebFlyPostBackListener).
Later on at ClientSide, with WebFlyPostBackManager you can request an execution of Method at WebForm (e.g HelloWorld()) and retrieve its return value at
OnResponseSuccess Event.
Note: The Method that is going to be executed must be marked with[WebFlyPostBackMethod()]
MyPage.aspx.cs
public partial class MyPage : System.Web.UI.Page
{
WebFlyPostBackListener listener = null;
protected void Page_Load(object sender, EventArgs e)
{
listener = new WebFlyPostBackListener(this);
}
[WebFlyPostBackMethod()]
public string HelloWorld()
{
return "Hello World";
}
}
<script language="javascript" type="text/javascript">
<!--
function OnClientClick(controlId, parameter)
{
var FPBMan = ISGetObject("WebFlyPostBackManager1");
FPBMan.HelloWorld();
return true;
}
function OnResponseSuccess(controlId, method, returnValue)
{
alert("The return value of HelloWorld method is: " + returnValue);
}
-->
</script>
Related Topics
WebFlyPostBack
Features