B
bienwell
Hi,
I have a question about file included in ASP.NET. I have a file that
includes all the Sub functions (e.g FileFunct.vb). One of the functions
in this file is :
Sub TestFunct(ByVal strInput As String)
return (strInput & " test")
End Sub
I'd like to call this function in FileFunct.vb from another .ASPX file
like this :
<%@ import Namespace="System" %>
<%@ import Namespace="System.Data" %>
<html>
<head>
<title>Test page</title>
</head>
<body>
<script runat="server" language="VB" scr="FileFunct.vb" >
Sub Page_Load(s As Object, e As EventArgs)
Dim result=TestFunct("This is a string")
response.write("<BR>result ==> " & result)
End Sub
</script>
</body>
</html>
I've got this error:
Server Error in '/' Application.
----------------------------------------------------------------------------
----
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'TestFunct' is not declared.
Source Error:
Line 18: Sub Page_Load(s As Object, e As EventArgs)
Line 19:
Line 20: Dim result=TestFunct("This is a string")
Line 21: response.write("<BR>Result ==> " & Result)
Line 22:
I have a single .ASPX file and I don't use Visual studio. NET in this case.
Can I do that ?
Thanks in advance.
I have a question about file included in ASP.NET. I have a file that
includes all the Sub functions (e.g FileFunct.vb). One of the functions
in this file is :
Sub TestFunct(ByVal strInput As String)
return (strInput & " test")
End Sub
I'd like to call this function in FileFunct.vb from another .ASPX file
like this :
<%@ import Namespace="System" %>
<%@ import Namespace="System.Data" %>
<html>
<head>
<title>Test page</title>
</head>
<body>
<script runat="server" language="VB" scr="FileFunct.vb" >
Sub Page_Load(s As Object, e As EventArgs)
Dim result=TestFunct("This is a string")
response.write("<BR>result ==> " & result)
End Sub
</script>
</body>
</html>
I've got this error:
Server Error in '/' Application.
----------------------------------------------------------------------------
----
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'TestFunct' is not declared.
Source Error:
Line 18: Sub Page_Load(s As Object, e As EventArgs)
Line 19:
Line 20: Dim result=TestFunct("This is a string")
Line 21: response.write("<BR>Result ==> " & Result)
Line 22:
I have a single .ASPX file and I don't use Visual studio. NET in this case.
Can I do that ?
Thanks in advance.