-1

以下のコードを使用して ac# 関数を呼び出していますが、ユーザー コントロールではなく aspx ページで正常に動作しています。この問題の解決を手伝ってください。

function add_plan() {
            try {
                alert('enter');
                PageMethods.add_plan_Items(onSucceeded, onFailed);
            }
            catch (ex) {
                alert(ex);
            }

        }

        function CallParametersPageMethod() {
            try {
                PageMethods.MyFirstParameterPageMethod("This is a Demo", onSucceeded, onFailed);
            }
            catch (ex) {
                alert(ex);
            }
        }
        function onSucceeded(result, userContext, methodName) {
            $get('div1').innerHTML = result;
        }

        function onFailed(error, userContext, methodName) {
            alert("An error occurred")
        }
4

1 に答える 1

0

メソッドをコントロールのコードビハインドファイル(ascx.cs)からページのコードビハインドファイル(.aspx.cs)に移動する必要があります。または、Webサービスでメソッドを移動します。

于 2013-02-15T13:06:17.053 に答える