Monday, December 30, 2013

how to call webservice by javascript and scriptmanager?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="getservice.aspx.cs" Inherits="getservice" %>

<!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 runat="server">

<title></title>

<script language="javascript" type="text/javascript">

function SendRequest() {



Repw.LoadStatixText1(1, OnComplete, OnError,

OnTimeOut);

}

function OnComplete(arg) {



alert(arg);

}

function OnTimeOut(arg) {

alert("timeOut has occured");



}

function OnError(arg) {

alert("error has occured: " + arg._message);



}

</script>

</head>

<body onload="SendRequest();">

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

<Services>

<asp:ServiceReference Path="~/repw.asmx" />

</Services>

</asp:ScriptManager>







</form>

</body>

</html>

No comments:

Post a Comment