Lets say I have a class like this in class1.vb:
Public Class my_class
Public Sub my_sub()
Dim myvar as String
myvar = 10
Session("myvar") = myvar
End Sub
End Class
Then I have a ASP.NET page with a code-behind file, default.aspx and default.aspx.vb and I want to call my_class. I'm doing the following, but it doesn't work:
Imports my_app.my_class
Partial Public Class _default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender as Object, ByVal e as System.EventArgs) Handles Me.Load
my_class()
End Sub
End Class
I get a "Reference to a non-shared member requires an object reference"