473,651 Members | 2,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Reg ularExpressions .Regex(pattern,
System.Text.Reg ularExpressions .RegexOptions.C ompiled)

If RegEx.IsMatch(p URL) 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.Reg ularExpressions .Regex(pattern,
System.Text.Reg ularExpressions .RegexOptions.C ompiled)

If RegEx.IsMatch(p Email) 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 1296
"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....so rry 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
2596
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 topics to include in a course on object-orientation that I'm going to conduct. (I will later summarize all the replies and discussion, for the
9
1599
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 trying to put in images and floating them left or right. In safari it leaves a gap inbetween two of my divs and the image overlaps the gap, in IE it does the same unti you mouse over the hyperlink in the div, which then hides the gap and puts...
14
1646
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
1470
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 do it. So I decided to do most of the pages in HTML, which i'll be doing soon. And since he's a Flooring Contractor, I decided to do an Estimate Sheet page in ASP. I've done C# courses and never had any problems with the programming aspect, but...
2
1796
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 please? Thanks a million in advance. Al *******CODE**********
59
4977
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 ASP.NET. At first glance, it looks excellent, albeit nothing that couldn't have been done to Classic ASP. I have been through a few tutorials and was impressed with how quickly you can get database info onto a page.
2
1660
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 showing all filetypes and icons. I have an object that has extension, desc (like Word Document) and then icon, which is nothing to start with. I have a collection object of these and when it is initialized it goes to
1
9623
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 and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
17
2280
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 scripts. each when clicked i am able to run the script. so HOW and what do i do to call and run the .sql Thanks
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8803
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7298
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.