Hello,
I am still relatively inexperienced with ASP.NET and am trying to create some of my own classes using VB.NET and reference them in my ASP.NET pages.
So far I have created a simple 'Global.vb' file defining a class that I have called 'GlobalClass'. The initial code is as follows:
Imports System
Namespace GlobalNS
Public Class GlobalClass
Public Sub New()
End Sub
Public Function Login(u as String, p as String) as Boolean
return true
End Function
End Class
End Namespace
As you can see it doesn't do much yet! Note that at this stage I have called the Namespace 'GlobalNS'.
My question is how can I reference the functions and properties of this class from my ASP.NET page. So far I have tried creating a new instance of the class using:
Dim gc as New GlobalClass()
If (gc.Login) then...
But I get a compilation error saying that 'GlobalClass' is not defined.
Unfortunately, creating custom classes is 'out of the scope' of the new textbook I have just bought, and I haven't had much luck searching on the web. Could someone please explain what I am doing wrong and point me in the right direction so that I can get back on track!!
Thanks in advance
I am still relatively inexperienced with ASP.NET and am trying to create some of my own classes using VB.NET and reference them in my ASP.NET pages.
So far I have created a simple 'Global.vb' file defining a class that I have called 'GlobalClass'. The initial code is as follows:
Imports System
Namespace GlobalNS
Public Class GlobalClass
Public Sub New()
End Sub
Public Function Login(u as String, p as String) as Boolean
return true
End Function
End Class
End Namespace
As you can see it doesn't do much yet! Note that at this stage I have called the Namespace 'GlobalNS'.
My question is how can I reference the functions and properties of this class from my ASP.NET page. So far I have tried creating a new instance of the class using:
Dim gc as New GlobalClass()
If (gc.Login) then...
But I get a compilation error saying that 'GlobalClass' is not defined.
Unfortunately, creating custom classes is 'out of the scope' of the new textbook I have just bought, and I haven't had much luck searching on the web. Could someone please explain what I am doing wrong and point me in the right direction so that I can get back on track!!
Thanks in advance