私はいくつかのデータをサーバー側のVB.Netメソッドに供給するWebページにいくつかのAjaxを持っています。そのデータがサーバー側のメソッドに含まれたら、今収集したデータを使用するために別のサーバー側のメソッドを呼び出す必要があります。もちろん、VB.Net:共有サブから呼び出すサブ
' This method gets the input from the Ajax code on the web page.
<System.Web.Services.WebMethod> _
Public Shared Sub GetAwesome(VBInputText As String)
Dim strTest As String = VBInputText
' Now that we have collected input from the user,
' we need to run a method that does a ton of other stuff.
DisplayAwesome(VBInputText)
End Sub
Protected Sub DisplayAwesome(AwesomeIn As String)
' The real app does a lot more than this. For this example, it
' just sets the text of a literal.
litAwesomeResult.Text = AwesomeIn
End Sub
上記の例DisplayAwesome(VBInputText)
で私に「インスタンスメンバを参照することはできません...」というエラーを与える:ここでは本当に簡単な例です。だから、からPublic Shared Sub GetAwesome
に電話をかけることは可能ですか?私はこの種の解決策に近づくことを望んでいる。なぜなら、既に別の同僚によって書かれているので、アプリでうまくいくからだ。
はGetAwesome 'の宣言()'から共有削除 – djv