Saturday, March 24, 2012

Works on locaol Machine but doesnt work on live server

I created an atlas page:

<cc1:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="True">

<Services>

<cc1:ServiceReferencePath="AtlasServicestesting.asmx"Type="text/javascript"/>

</Services>

</cc1:ScriptManager>

<tableborder="0"cellspacing="0"cellpadding="0">

<tr>

<tdalign="left"valign="top"colspan="3"style="height: 8px"><imgsrc="../../images/spacer.gif"width="329"height="8"/></td>

</tr>

<trclass="copy_bold">

<tdalign="left"style="height: 13px; width: 135px"valign="top">

<span><asp:LabelID="Label1"runat="server"Text="Available Dates"></asp:Label></span></td>

<tdalign="left"style="height: 13px; width: 175px"valign="top">

<span><asp:LabelID="Label2"runat="server"Text="Location"></asp:Label></span></td>

<tdalign="left"style="height: 13px; width: 30px"valign="top">

</td>

</tr>

<trclass="copy_standard">

<tdalign="left"style="height: 13px; width: 135px"valign="top">

<span><asp:LabelID="lblDates"runat="server"Text=""></asp:Label></span></td>

<tdalign="left"style="height: 13px; width: 175px"valign="top">

<span><asp:LabelID="lblLocation"runat="server"Text=""></asp:Label></span></td>

<tdalign="left"style="height: 13px; width: 30px"valign="top">

</td>

</tr>

</table>

<br/>

<inputid="T1"type="button"value="Testing"onclick="sayHelloFromWS();"/>

</div>

<scripttype="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")+strReturn

strLocation+=tb.getItem(i).getProperty("Lev")+strReturn

}

document.getElementById("lblDates").innerHTML=strDates

document.getElementById("lblLocation").innerHTML=strLocation

}

</script>

My Webservice Page just like:

<WebMethod()> _

PublicFunction HelloWorld()As DataSet

Dim StrSqlAsString

StrSql ="Select * from ref_SchoolLev where month(Actdates)=10 and Lev='G4'"

Dim StrConnAsString

StrConn ="......"

Dim myConnAsNew SqlConnection(StrConn)

Dim myAdapterAs SqlDataAdapter

myAdapter =New SqlDataAdapter(StrSql, myConn)

myConn.Open()

Dim myDatasetAsNew DataSet

myAdapter.Fill(myDataset)

myConn.Close()

Return myDataset

EndFunction

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!!!

I create an Atlas page with ASP.net 2.0 webservice. It works in local server. It also works in https:// live site. But in http:// live site, it doesn't work.

Another strange thing is that even the http:// live site works on one of my co-worker's computer. We check the setting of browser and windows. But we don't know what happen. Please help!!!


I am having the opposite problem. See the threadhttp://forums.asp.net/thread/1482244.aspx

My test server does not use https, but production does. Maybe it has something to do with the way the asp.net ajax *.js files are cached the first time (secure vs. nonsecure). I'm going to try clearing my browsing history...


This didn't help.

No comments:

Post a Comment