Its not that simple as calling webservice methods from Input button or server-side button control click event.

Here I found pageLoad() (case sensitive) event  which is specifically accomodated with Atlas to support the javascript "onLoad" events e.g. calling a WebMethod from onLoad event of body element.

Only "pageLoad()" can call the WebMethod in the following example:-

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head id="Head1" runat="server">
<title>Untitled Page</title>
<atlas:ScriptManager ID="scriptManager" runat="server" EnableScriptComponents="false" >
<Services>
<atlas:ServiceReference Path="SimpleService.asmx" Type="text/javascript" />
</Services>
</atlas:ScriptManager>
<script type="text/javascript" language="JavaScript">
//if we call this on body onLoad will raise error
function OnStart() {
//Call script proxy passing the input element data
requestSimpleService = Quickstart.Samples.SimpleService.EchoString("Hello",OnComplete);
return false;
}

//only pageLoad will call the webmethod
function pageLoad()
{
//Call script proxy passing the input element data
requestSimpleService = Quickstart.Samples.SimpleService.EchoString("pageLoad event is supported by Atlas!!",OnComplete);
return false;
}

function OnComplete(result) {
alert(result);
}
</script>
</head>
<
body onload="pageLoad()">

<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</
html>

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Feedback

# re: pageLoad() event in Atlas

Good info, Thanks. 7/31/2006 4:17 PM | mano mangaldas

# re: pageLoad() event in Atlas

Crazy but true - i just don't understand why they'd have to do it this way. 9/22/2006 10:26 PM | nitin ahuja

Post a comment





 

 

News

Employers
Soppa Group India
iSmart Panache Inc
R Systems Internationals Ltd
Technovate eSolutions Pvt Ltd
The contents of this blog are my personal opinion and do not represent in any way the view of my employer.
These postings are provided "AS IS" with no warranties, and confer no rights.

Google PR™ - Post your Page Rank with MyGooglePageRank.com

Archives

Post Categories

Image Galleries

Articles & Magazines

ASP.Net 2.0 Compilation

ASP.Net, Blogs I refer...

Atlas

Dost

Drivers and Software Download

Garhwal

Travel Domain

WSS and WebParts

Syndication: