473,410 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Please help, going crasy! :(

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.Compil ed)

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.Compil ed)

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

Feb 13 '07 #1
5 1286
"Nemisis" wrote ...
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
Hmm, odd, I've not used "modules" myself, just typically classes, but the
one thing I have to do with those is instantiate them....

Thus...

GeneralMethods = New GeneralMethods

then you get to use it...

GeneralMethods.IsUrl(TextBox1.Text)

Not sure if this is the case with your problem, as I said I'm not so
familiar with modules...

HTH

Rob
Feb 13 '07 #2
nah, not that either, i have already tried that, but thanks anyway.

Feb 13 '07 #3
"Nemisis" wrote ...
nah, not that either, i have already tried that, but thanks anyway.
hmm...odd....sorry it didn't help...

Rob
Feb 13 '07 #4
No probs, i am running SP1. Does anyone else have the same problem if
they try it on theres?

Version 8.0.50727.762 (SP.050727-7600) - Is this the correct version?
Hopefully i havent updated with a Beta SP release lol?

Feb 13 '07 #5
Try using classes, not modules. If I am not mistaken in VB.NET a "Module" is
the equivalent of a static (Shared) class.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Nemisis" wrote:
No probs, i am running SP1. Does anyone else have the same problem if
they try it on theres?

Version 8.0.50727.762 (SP.050727-7600) - Is this the correct version?
Hopefully i havent updated with a Beta SP release lol?

Feb 13 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
9
by: Daz | last post by:
Hello hello! I'm trying to finish off putting my design into HTML and I've come across a problem that I can't get my head around. I've got divs floating in two columns, but I'm having problems...
14
by: HP | last post by:
Hi All i have confussion regarding given problem please help me out 4. What happens with the following program: void main(){ myclass* pmc = new myclass; pmc = 0; delete pmc;}
4
by: Corey Dyke | last post by:
K here's what happened. For my English project at DeVry, I had to design a website for a company of my choice. So since my dad has been after me for years to do one for him, I decided to finally...
2
by: almurph | last post by:
folks, Please help. I'm trying to build a user defined control that displays a time stamp that ticks. Here is what i have so far - it's using threads but is not working. Can anyone help me...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.