我的代码调用了一个 WebMethod。在该 WebMethod 中,我需要创建一个新的控件集合。在VB中,我通常会写:
Dim cc As System.Web.UI.ControlCollection = CreateControlCollection()
但是因为我在 WebMethod 中,所以我得到了错误:
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.
请问有什么建议吗?谢谢各位!