What happened to Modules in VB.NET 2005 Web development

I am trying to transfer my web site developed with VB.NET 2003 and ASP.NET 1.1 to VB.NET 2005 and ASP.NET 2.0
I have quite a lot of functions that I reuse throughout the different pages, so I have put them in a module. But when I transfer the site to ASP.NET 2.0 it no longer recognizes modules. Is there another easy way to make public functions and subs?
Thanks.
JJRDK
[391 byte] By [jjrdk] at [2007-12-16]
# 1

Isn't that what Global.aspx is for?

BlairStark at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
I assume you mean "global.asax". I tried putting the code there but even though it's a public class it is not possible to reuse the functions.

JJRDK

jjrdk at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

A great way to write shared/reusable code in general is to created a public class and place it in the App_Code folder.

For example

Defining central code:

1) Add New Item -> Class
2) name it "Helpers" -> OK



Imports Microsoft.VisualBasic

Public Class Helpers

Public Sub InstanceMethod()

End Sub

Public Sub SharedMethod()

End Sub

End Class

Using code


'call instance method

Dim h as New Helpers
h.InstanceMethod

'call shared method (there is no need to Dim a variable)

Helpers.SharedMethod


This should do the trick for you in general.

Best,

Paul Yuknewicz
Visual Basic

PaulYuk_MS at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...