Hello everyone, I have this webmethod, this is how I called it:
<WebMethod()> _
Public Shared Function TestMethod() As String
Dim dt As New DataTable()
dt=GetSomeIDFunction()
End Function
I needed to call a function (GetSomeIDFunction) within that WebMethod. What declaration should I used for GetSomeIDFunction()? If I declared it like this:
Private Function GetSomeIDFunction() As DataTable
End Function
The function in the web method threw an error saying "Cannot refer to an instance member of a class within a shared method..." However, if I declared my function like this:
Private shared Function GetSomeIDFunction() As DataTable
End Function
the error is gone but GetSomeIDFunction function can't access my controls on the page anymore.
Thanks
...
Go to the complete details ...