I created an atlas page:
<cc1:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True">
<Services>
<cc1:ServiceReference Path="AtlasServicestesting.asmx" Type="text/javascript" />
</Services>
</cc1:ScriptManager>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" colspan="3" style="height: 8px"><img src="../../images/spacer.gif" width="329" height="8" /></td>
</tr>
<tr class="copy_bold">
<td align="left" style="height: 13px; width: 135px" valign="top">
<span><asp:Label ID="Label1" runat="server" Text="Available Dates"></asp:Label></span></td>
<td align="left" style="height: 13px; width: 175px" valign="top"> <span><asp:Label ID="Label2" runat="server" Text="Location"></asp:Label></span></td>
<td align="left" style="height: 13px; width: 30px" valign="top"> </td> </tr>
<tr class="copy_standard">
<td align="left" style="height: 13px; width: 135px" valign="top">
<span><asp:Label ID="lblDates" runat="server" Text=""></asp:Label></span></td>
<td align="left" style="height: 13px; width: 175px" valign="top"> <span><asp:Label ID="lblLocation" runat="server" Text=""></asp:Label></span></td>
<td align="left" style="height: 13px; width: 30px" valign="top"> </td> </tr>
</table>
<br />
<input id="T1" type="button" value="Testing" onclick="sayHelloFromWS();"/>
</div>
<script type="text/javascript">
function sayHelloFromWS() {AtlasServicesTesting.HelloWorld(onComplete);
}
function onComplete(result) {var tb =result.getItem(0)var i=0;var strDates=""
var strLocation=""
var strReturn="<br />"
for(i=0;i<tb.get_length();i++){
strDates+=tb.getItem(i).getProperty("Dates")+strReturnstrLocation+=tb.getItem(i).getProperty("Lev")+strReturn}
document.getElementById("lblDates").innerHTML=strDatesdocument.getElementById("lblLocation").innerHTML=strLocation}
</script>
My Webservice Page just like:
<WebMethod()> _
Public Function HelloWorld() As DataSetDim StrSql As String
StrSql = "Select * from ref_SchoolLev where month(Actdates)=10 and Lev='G4'"
Dim StrConn As String
StrConn = "........"
Dim myConn As New SqlConnection(StrConn)Dim myAdapter As SqlDataAdaptermyAdapter = New SqlDataAdapter(StrSql, myConn)myConn.Open()
Dim myDataset As New DataSetmyAdapter.Fill(myDataset)
myConn.Close()
Return myDatasetEnd Function
I also change the web.configure file. And the page works well when I publish the whole site to local server. But it gives me error message like: "object doesn't support this property ot method and The server method 'HelloWorld' failed with the following error:" when I publish the site to live server. I don't know why. Please help!!!