Intersoft WebDesktop Documentation
Service Type
See Also Send Feedback
Intersoft WebDesktop > WebFlyPostBackManager > Concepts > Service Type

Glossary Item Box

WebFlyPostBackManager can be used to retrieve data or execute methods from two type of services.

 

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()]

Sample Code

WebServiceSamples.asmx 

<%@ WebService Language="C#" CodeBehind="~/App_Code/WebServiceSamples.cs" Class="WebServiceSamples" %>
WebServiceSamples.cs
[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";
}

}
Page.aspx
<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()]

Sample Code

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";

}

}
MyPage.aspx
<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>

See Also

Related Topics
WebFlyPostBack
Features

© 2012 Intersoft Solutions Corp. All Rights Reserved.