Niestety to samo
Otóż coś musi być źle chyba po stronie formularza.
Bo aplikacja jest robiona tak, żeby dało się z niej korzystać po stronie klienta(zrobiony formularz również w vb)
Jeśli chodzi o uruchomienie tego po stronie 'serwera' to normalnie wynik wyświetla się dobry tylko w kodzie xml
Zrobiłem do tego formularz w tabeli żeby zamieniał te temperatury i tutaj niestety wynik podaje błędny
Podam może cały kod tych aplikacji.
Najpierw od strony 'serwer' :
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function FahrenheitNaCelcius _
(ByVal Fahrenheit As Double) As Double
Return ((Fahrenheit - 32) * 5) / 9
End Function
<WebMethod()> _
Public Function CelciusNaFahrenheit _
(ByVal Celcius As Double) As Double
Return ((Celcius * 9.0 / 5.0) + 32.0)
End Function
End Class
I poniżej od strony 'klient'
Może tu coś jest źle?
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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>
<style type="text/css">
.style1
{
width: 100%;
height: 287px;
}
.style2
{
text-align: center;
}
.style3
{
}
.style4
{
width: 224px;
}
.style5
{
width: 278px;
}
.style6
{
width: 269px;
height: 26px;
}
.style7
{
width: 278px;
height: 26px;
}
.style8
{
width: 224px;
height: 26px;
}
.style9
{
height: 26px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style2" colspan="4">
<strong>Konwersja temperatur w dwóch skalach: Farenheita i Celciusza<br />
</strong>
</td>
</tr>
<tr>
<td class="style3">
Temperatura dla Farenheita:</td>
<td class="style5">
<asp:TextBox ID="txtF" runat="server"></asp:TextBox>
</td>
<td class="style4">
Temperatura dla Celciusza</td>
<td>
<asp:TextBox ID="txtC" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td class="style5">
</td>
<td class="style4">
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td class="style5">
<asp:Button ID="cmdFnaC" runat="server" Text="Farenheit na Celciusz" />
</td>
<td class="style4">
</td>
<td>
<asp:Button ID="cmdCnaF" runat="server" Text="Celciusz na Farenheit" />
</td>
</tr>
<tr>
<td class="style3">
</td>
<td class="style5">
</td>
<td class="style4">
<asp:Button ID="cmdResetuj" runat="server" Text="Resetuj" />
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td class="style5">
</td>
<td class="style4">
</td>
<td>
</td>
</tr>
<tr>
<td class="style3">
Temperatura po konwersji w skali<br />
Celciusza</td>
<td class="style5">
<asp:TextBox ID="outC" runat="server" ReadOnly="True"></asp:TextBox>
</td>
<td class="style4">
Temperatura po konwersji w skali<br />
Farenheita</td>
<td>
<asp:TextBox ID="outF" runat="server" ReadOnly="True"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td class="style5">
</td>
<td class="style4">
</td>
<td>
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
</td>
<td class="style8">
</td>
<td class="style9">
</td>
</tr>
<tr>
<td class="style3" colspan="4">
</td>
</tr>
</table>
<div>
</div>
</form>
</body>
</html>