VB Module functions not available in 2005

G

Guest

I have upgraded my ASP.Net/VB solution from 2003 to 2005. In 2003 I had a VB
Module with global functions referenced in virtually all ASP.Net VB modules.
After the upgrade to 2005 the ASP.Net VB code no longer recognizes my global
VB Module functions.

How do I reference the functions in the module?

I have over 25 ASP.Net forms.

Thank you
 
G

Guest

Prefix the method names with the module name.
e.g., YourModule.YourFunction instead of YourFunction
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
C# Code Metrics: Quick metrics for C#
 
J

Jay B. Harlow [MVP - Outlook]

BigJohn,
Is the module in the App_Code folder of your web app?

Is there a namespace in the module?

I am able to put the following in App_Code/UtilityModule.vb and it gets used
by my aspx pages.

Option Strict On
Option Explicit On

Public Module UtilityModule

Public Function IIf(Of T)(ByVal expression As Boolean, ByVal
truePart As T, ByVal falsePart As T) As T
If expression Then
Return truePart
Else
Return falsePart
End If
End Function

End Module

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


|I have upgraded my ASP.Net/VB solution from 2003 to 2005. In 2003 I had a
VB
| Module with global functions referenced in virtually all ASP.Net VB
modules.
| After the upgrade to 2005 the ASP.Net VB code no longer recognizes my
global
| VB Module functions.
|
| How do I reference the functions in the module?
|
| I have over 25 ASP.Net forms.
|
| Thank you
|
|
 
G

Guest

Thank you Jay. Here is what I found and the correction taken.

In 2003 I had a folder named "GlobalComponents" which contained various
function, file and database functions. When I upgraded, these modules
remained in a folder named "GlobalComponents". When I moved them to
App_Code, all references functioned fine.
 
J

Jay B. Harlow [MVP - Outlook]

Thanks for the follow up.


--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Thank you Jay. Here is what I found and the correction taken.
|
| In 2003 I had a folder named "GlobalComponents" which contained various
| function, file and database functions. When I upgraded, these modules
| remained in a folder named "GlobalComponents". When I moved them to
| App_Code, all references functioned fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top