Problems with WebServer Behavior !

A

Alex Nitulescu

Hi. I have the following HTML (snip):

_____________________________________________
<body MS_POSITIONING="GridLayout" onload="Init()">
<form id="frmWebServerAdvanced_1Test" method="post" runat="server">
<div id="service" style="behavior:url(webservice.htc)"
onresult="Service_Result()"></div>
°Fahrenheit: <input id="txtFahrenheit">
<input type="Button" value="Convert !" onclick="Button_Click()">
<hr>
<span id="lblCelsius"></span>
</form>
</body>
_____________________________________________

and the following script:
_____________________________________________
<script language="javascript">

var intCallID=0;

function Init()
{
service.useService("http://localhost/aspnetprojects/vsnet/WebServerAdvanced_1/TemperatureWithBehaviour.asmx?WSDL","TemperatureWithBehaviour");}function Service_Result(){ //If there is an error, and the call came from the call() in init() if((event.result.error) && (intCallID == event.result.id)) { //Pull the error information from the event.result.errorDetailproperties var xfaultcode = event.result.errorDetail.code; var xfaultstring = event.result.errorDetail.string; var xfaultsoap = event.result.errorDetail.raw; alert(xfaultstring); //Add code to handle specific error codes here } //If there was no error, and the call came from the call() in init() else if((!event.result.error) && (intCallID == event.result.id)) { //Show the result ! lblCelsius.innertext="The result of the conversion is " +event.result.value + " °Fahrenheit" //alert("The result of the conversion is " + event.result.value +"°Fahrenheit"); } else { alert("Something else fired the event!"); }}function Button_Click(){ intCallID = service.TemperatureWithBehaviour.callService("ToCelsius",txtFahrenheit.value); //intCallID = service.TemperatureWithBehaviour.callService("ToCelsius",87);}</script>_____________________________________________I have the following problems -1. Microsoft JScript runtime error: 'txtFahrenheit' is undefinedIf I comment out the line, as above, and enter a fixed value, it works okay.2. lblCelsius.innertext does not work - it does not complain, but it simplydoes not work. However, ALERT works just fine. I obtain"The result of the conversions is 30.55..." etcWhat am I missing here ? I look at the HTML and everything seems to be inorder.Thank you, Alex.
 
A

Alex Nitulescu

Sorry, outlook completely messed up my tabs in the previous post. Here it is
again:

Hi. I have the following HTML (snip):

_____________________________________________
<body MS_POSITIONING="GridLayout" onload="Init()">
<form id="frmWebServerAdvanced_1Test" method="post" runat="server">
<div id="service" style="behavior:url(webservice.htc)"
onresult="Service_Result()"></div>
°Fahrenheit: <input id="txtFahrenheit">
<input type="Button" value="Convert !" onclick="Button_Click()">


--------------------------------------------------------------------------------


<span id="lblCelsius"></span>
</form>
</body>
_____________________________________________

and the following script:
_____________________________________________


<script language="javascript">

var intCallID=0;

function Init()

{

service.useService("http://localhost/aspnetprojects/vsnet/WebServerAdvanced_1/TemperatureWithBehaviour.asmx?WSDL","TemperatureWithBehaviour");}function Service_Result(){ //If there is an error, and the call came from the call() in init() if((event.result.error) && (intCallID == event.result.id)) { //Pull the error information from the event.result.errorDetailproperties var xfaultcode = event.result.errorDetail.code; var xfaultstring = event.result.errorDetail.string; var xfaultsoap = event.result.errorDetail.raw; alert(xfaultstring); //Add code to handle specific error codes here } //If there was no error, and the call came from the call() in init() else if((!event.result.error) && (intCallID == event.result.id)) { //Show the result ! lblCelsius.innertext="The result of the conversion is " +event.result.value + " °Fahrenheit" //alert("The result of the conversion is " + event.result.value +"°Fahrenheit"); } else { alert("Something else fired the event!"); }}function Button_Click(){ intCallID = service.TemperatureWithBehaviour.callService("ToCelsius",txtFahrenheit.value); //intCallID = service.TemperatureWithBehaviour.callService("ToCelsius",87);}</script>____________________________________________ I have the following twoproblems - 1. Microsoft JScript runtime error: 'txtFahrenheit' is undefinedIf I comment out the line, as above, and enter a fixed value, it works okay.2. lblCelsius.innertext does not work - it does not complain, but it simplydoes not work. However, ALERT works just fine. I obtain "The result of theconversions is 30.55..." etc What am I missing here ? I look at the HTML andeverything seems to be in order. Thank you, Alex.
 
A

Alex Nitulescu

Problems with WebServer Behaviour !
Hi. I have the following HTML (snip):
_____________________________________________
<body MS_POSITIONING="GridLayout" onload="Init()">
<form id="frmWebServerAdvanced_1Test" method="post" runat="server">
<div id="service" style="behavior:url(webservice.htc)"
onresult="Service_Result()"></div>
°Fahrenheit: <input id="txtFahrenheit">
<input type="Button" value="Convert !" onclick="Button_Click()">
<span id="lblCelsius"></span>
</form>
</body>
_____________________________________________
and the following script:
_____________________________________________
<script language="javascript">

var intCallID=0;

function Init()
{
service.useService("http://localhost/aspnetprojects/vsnet/WebServerAdvanced_1/TemperatureWithBehaviour.asmx?WSDL","TemperatureWithBehaviour");}function Service_Result(){ //If there is an error, and the call came from the call() in init() if((event.result.error) && (intCallID == event.result.id)) { //Pull the error information from the event.result.errorDetailproperties var xfaultcode = event.result.errorDetail.code; var xfaultstring = event.result.errorDetail.string; var xfaultsoap = event.result.errorDetail.raw; alert(xfaultstring); //Add code to handle specific error codes here } //If there was no error, and the call came from the call() in init() else if((!event.result.error) && (intCallID == event.result.id)) { //Show the result ! lblCelsius.innertext="The result of the conversion is " +event.result.value + " °Fahrenheit" //alert("The result of the conversion is " + event.result.value +"°Fahrenheit"); } else { alert("Something else fired the event!"); }}function Button_Click(){ intCallID = service.TemperatureWithBehaviour.callService("ToCelsius",txtFahrenheit.value); //intCallID = service.TemperatureWithBehaviour.callService("ToCelsius",87);}</script>_____________________________________________I have the following two problems -1. Microsoft JScript runtime error: 'txtFahrenheit' is undefinedIf I comment out the line, as above, and enter a fixed value, it works okay.2. lblCelsius.innertext does not work - it does not complain, but it simplydoes not work. However, ALERT works just fine. I obtain"The result of the conversions is 30.55..." etcWhat am I missing here ? I look at the HTML and everything seems to be inorder.Thank you, Alex.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top