我有一个公共类“General”,其中是一个Public Sub“updateDynamics”.当我尝试在代码隐藏中引用这样的页面时:
updateDynamics(get_prospect.dynamicsID)
我收到以下错误:
reference to a non-shared member requires an object reference
您必须使该方法共享或使用一般类的实例:
Dim gen = New General() gen.updateDynamics(get_prospect.dynamicsID)
要么
General.updateDynamics(get_prospect.dynamicsID) Public Shared Sub updateDynamics(dynID As Int32) ' ... ' End Sub