我有以下网络方法
<System.Web.Services.WebMethod()> Public Shared Function NewMethod(ByVal str1 As String) As String
LoadBlock(str1)
Return "Success"
End Function
和以下程序
Public Sub LoadBlock(ByVal AA As Integer)
panAway.Visible = False '<--ASP panel control
lblHome.Visible = False '<--ASP label control
End
这会引发以下错误
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.
我了解我收到以下错误,因为我没有将 LoadBlock 设置为共享
但是如果我这样做,我的程序中的所有控件......引发上面的错误
我能做些什么吗?