You are not Logged in
Would you like to Login or Register

Today is: Friday, 21 November, 2008
Check this months hot topics

Calling a WebService (from JavaScript) with Atlas

This is too easy and damn powerful! WebServices can be called from JavaScript directly once the service is registered in the Script Manager.

Script Manager

Add your service to the manager as seen below:

<atlas:ScriptManager runat="server" ID="sb1" EnablePartialRendering="true" >
    <Services>
        <atlas:ServiceReference Path="~/YourService.asmx" />
    </Services>
</atlas:ScriptManager>

JavaScript

Once the ScriptManager has discovered the web service, it creates all the objects for you..

<script language="javascript">
//<!--
function callYourService(){

    // call ClassName.MethodName();
    YourService.HelloWorld();

}
//-->
</script>

The above example is a very simple one.. It is possible to return an AtlasDataSet or your own object.

kick it on DotNetKicks.com del.icio.us digg Mister Wong YahooMyWeb Reddit Furl Spurl blogmarks
Paul Hayman Skype
Author : Paul Hayman
Published : Wednesday, 12 July, 2006

Paul is the COO of kwiboo ltd consultant and has more than a decade of IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services. Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.

Add Comment

Enter your comment below and it will be submitted for moderation.

Your Name

Add Tag

Please enter tags for this article, seperated by semi-colon ;

View Tag's by : # articles | # views