Marek Nowak
1/6/2003 12:48:00 PM
Hi all,
I going mad with this problem
I have file: kalk.asmx
-----------------------------------------------------------------------
<%@ WebService language="VB" class="KALK" %>
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Public Class KALK
<WebMethod> Public Function Dodawanie(a As Integer, b As Integer) As
Integer
Return a + b
End Function
End Class
----------------------------------------------------------------------------
------
I generate VB (i add in this file: NameSpace Kalkulator) and DLL files
and i have file: kalk.aspx
----------------------------------------------------------------------------
--
<%@ Page Language="VB" %>
<script runat="server">
sub Page_Load(obj as object, e as eventargs)
dim objCalc as new Kalkulator.KALK()
lblMessage.Text = objCalc.Dodawanie(1,5)
end sub
</script>
<html>
<head>
</head>
<body>
1 + 5 = : <asp:Label id="lblMessage" runat="server"></asp:Label>
</body>
</html>
----------------------------------------------------------------------------
---------
when i run this file (kalk.aspx) i have error
Exception of type System.InvalidCastException was thrown.
error is in this line:
dim objCalc as new Kalkulator.KALK()
where is the problem??
please help me!!!!!!!!!!!
When i strat it on webmatrix is run ok
Thanks a lot!!!
Marek Nowak