How to call a Sub function from .ASPX file ?



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.


.



Relevant Pages

  • Re: Server Error in / Application.
    ... >> Whats wrong with my code? ... >> End Sub ... >> Compilation Error ... >> EventArgs) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Compilation Error
    ... delegate requires a Sub that takes an Object and an instance of EventArgs ... > Compilation Error ... without even the implied warranty of merchantability ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Parse error message - repeat under managed account
    ... since redoing the server extensions, ... Compilation Error ... Line 12: End Sub ... without even the implied warranty of merchantability ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • CodeBehind error
    ... Compilation Error ... Compiler Error Message: BC30456: 'SelectedDate' is not a member of ... Sub DayChanged(s as Object, e As EventArgs) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to call a Sub function from .ASPX file ?
    ... Public Class EFiling_Funct ... Public Shared Function TestFunct(ByVal strInput As String) ... Sub Page_Load ... >> Compilation Error ...
    (microsoft.public.dotnet.framework.aspnet)