The datasource only works with services that derive from DataService (afaik). If you want to bind a return value of a webservice method call (or page call I believe), you should use the ServiceMethod control. It works something like this:
A few things to note:
1. At this moment I don't believe there is a ServiceMethod server-control, and there are apparently issues with "code-behind" atlas files, so that is why I gave you an idea of how to do this all client-side.
2. If you want to bind against an actual data item itself, and not a property of that dataitem, you should be able to leave the datapath empty (or not define it at all).
3. In this example, the serviceMethod is invoked when the page is loaded. When the serviceCall is completed (ie. you got the return value from the service), the serviceMethod control will call your label's binding's "evaluateIn" method to actually "do" the
binding.
4. The binding is set to automatic=false because we don't want the binding to be "done" when the application is loaded. See #3.
WilcoB
Participant
1454 Points
290 Posts
Re: binding atlas:label control to a page method?
Oct 06, 2005 06:20 PM|LINK
<serviceMethod id="myServiceMethod" serviceURL="MyService.asmx" serviceMethod="GetName">
<completed>
<invokeMethod target="myNameBinding" method="evaluateIn" />
</completed>
</serviceMethod>
<label targetElement="myNameLabel">
<bindings>
<binding id="myNameBinding" Property="text" automatic="false" />
</bindings>
</label>
<application>
<load>
<invokeMethod target="myServiceMethod" method="invoke" />
</load>
</application>
A few things to note:
1. At this moment I don't believe there is a ServiceMethod server-control, and there are apparently issues with "code-behind" atlas files, so that is why I gave you an idea of how to do this all client-side.
2. If you want to bind against an actual data item itself, and not a property of that dataitem, you should be able to leave the datapath empty (or not define it at all).
3. In this example, the serviceMethod is invoked when the page is loaded. When the serviceCall is completed (ie. you got the return value from the service), the serviceMethod control will call your label's binding's "evaluateIn" method to actually "do" the binding.
4. The binding is set to automatic=false because we don't want the binding to be "done" when the application is loaded. See #3.