0
Ajax 페이지 메서드 함수가 성공을 리턴하고 버튼없이 클릭하여 보호 된 하위로 함수를 호출 할 때 함수를 호출해야합니다. ClientScript를 메서드 나 공유 함수에 직접 포함 할 수 없으며 메서드가 호출을 허용하지 않습니다. Public Sub UpdateText()없이 을 공유하지 않으셨습니까?ASP.NET 페이지에서 버튼을 사용하여 Ajax 메서드로 ClientScript 호출하기
'''' Method for Ajax with SQL and other functions
'''' ----------------------------------------------------------
<WebMethod()> _
Public Shared Function SendOrder(ByVal fulldata As String,
_ByVal id As Integer) As String
Try
UpdateText()
Return "Success"
Catch ex As Exception
Return "failure"
End Try
End Function
그리고 여기, 나는 static.They 인스턴스 속성과 페이지 클래스의 방법과 상호 작용할 수 없습니다해야
'''' Function to call only on success
'''' ----------------------------------------------------------
Public Sub UpdateText()
Dim jsUpdate As String
Dim cstype As Type
Dim cs As ClientScriptManager = Page.ClientScript
Dim jsUpdateTxt As String = "<script language='javascript'>...</script>"
ClientScript.RegisterStartupScript(cstype, jsUpdate, jsUpdateTxt)
End Sub