N
Nemisis
Hi everyone,
I am currently building my .Net website, everything was fine, until i
decided to put some generic functions into a module. The module is
located in App_Code, with 2 other of my Modules. but for some reason
everytime i try to call the function i get an error of "Name
'GeneralMethods' is not defined".
here is my module, as you can see very simple
Module GeneralMethods
' Function returns a Boolean, to determine if the string passed
in, is a valid Url
Public Function IsURL(ByVal pURL As String) As Boolean
Dim pattern As String = "http://([\/~_\.0-9A-Za-z#&-?]+)"
Dim RegEx As New System.Text.RegularExpressions.Regex(pattern,
System.Text.RegularExpressions.RegexOptions.Compiled)
If RegEx.IsMatch(pURL) Then
Return True
Else
Return False
End If
End Function
' Function returns a Boolean, to determine if the string passed
in, is a valid Email address
Public Function IsEmail(ByVal pEmail As String) As Boolean
Dim pattern As String = "[\w-]+@([\w-]+\.)+[\w-]+"
Dim RegEx As New System.Text.RegularExpressions.Regex(pattern,
System.Text.RegularExpressions.RegexOptions.Compiled)
If RegEx.IsMatch(pEmail) Then
Return True
Else
Return False
End If
End Function
End Module
And on the Asp.Net page, i am calling it as follows :
GeneralMethods.IsUrl(TextBox1.Text)
Can someone please help, i have tried putting the word "Public" in
front of Module, i have added the word "Shared" to all the functions
inside the module, still no difference. This module is nearly
identical to my other modules, which work perfect. Thanks in advanced
I am currently building my .Net website, everything was fine, until i
decided to put some generic functions into a module. The module is
located in App_Code, with 2 other of my Modules. but for some reason
everytime i try to call the function i get an error of "Name
'GeneralMethods' is not defined".
here is my module, as you can see very simple
Module GeneralMethods
' Function returns a Boolean, to determine if the string passed
in, is a valid Url
Public Function IsURL(ByVal pURL As String) As Boolean
Dim pattern As String = "http://([\/~_\.0-9A-Za-z#&-?]+)"
Dim RegEx As New System.Text.RegularExpressions.Regex(pattern,
System.Text.RegularExpressions.RegexOptions.Compiled)
If RegEx.IsMatch(pURL) Then
Return True
Else
Return False
End If
End Function
' Function returns a Boolean, to determine if the string passed
in, is a valid Email address
Public Function IsEmail(ByVal pEmail As String) As Boolean
Dim pattern As String = "[\w-]+@([\w-]+\.)+[\w-]+"
Dim RegEx As New System.Text.RegularExpressions.Regex(pattern,
System.Text.RegularExpressions.RegexOptions.Compiled)
If RegEx.IsMatch(pEmail) Then
Return True
Else
Return False
End If
End Function
End Module
And on the Asp.Net page, i am calling it as follows :
GeneralMethods.IsUrl(TextBox1.Text)
Can someone please help, i have tried putting the word "Public" in
front of Module, i have added the word "Shared" to all the functions
inside the module, still no difference. This module is nearly
identical to my other modules, which work perfect. Thanks in advanced