D
DJ Dev
I have a shared sub which does some stuff on an ASP Table
(<asp:Table>). The code is
Public Class MyClass Inherits System.Web.UI.Page
Public WithEvents myTable As System.Web.UI.WebControls.Table
Public shared sub Doit()
'Do some stuff
myTable.Rows.Add(r)
End Sub
When I call this shared sub from another class, I get an error :
Cannot refer to an instance member of a class from within a shared
method or shared member initializer without an explicit instance of
the class.
I know that the problem is that when I call it, the calling function
(from the other class) doesnt know in what reference myTable is. But I
dont know how to fix this. Please help.
Thanks!
(<asp:Table>). The code is
Public Class MyClass Inherits System.Web.UI.Page
Public WithEvents myTable As System.Web.UI.WebControls.Table
Public shared sub Doit()
'Do some stuff
myTable.Rows.Add(r)
End Sub
When I call this shared sub from another class, I get an error :
Cannot refer to an instance member of a class from within a shared
method or shared member initializer without an explicit instance of
the class.
I know that the problem is that when I call it, the calling function
(from the other class) doesnt know in what reference myTable is. But I
dont know how to fix this. Please help.
Thanks!