2017-03-27 17 views
0

でクリックイベントを結合すると、次のコードスニペットは、私にランタイム例外は、JScriptの

System.Reflection.TargetInvocationExceptionは、次の例外を与えて上げ。 ---> Microsoft.JScript.JScriptException:呼び出しのターゲットが例外をスローされています。機能は

スタックトレースが

System.Reflection.TargetInvocationExceptionであると予想しました。 ---> Microsoft.JScript.JScriptException:Microsoft.JScript.LateBinding.Call(バインダーバインダー、オブジェクト[]引数、ParameterModifier []修飾子、CultureInfoカルチャ、String [] namedParameters、Boolean構文、ブールブラケット、VsaEngine Microsoft.JScript.LateBinding.Call(Object []引数、ブール構造、ブール代数、VsaEngineエンジン) ---内部例外スタックトレースの末尾--- at System.RuntimeMethodHandle.InvokeMethod(Object target、 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj、Object [] parameters、Object [] arguments)の の場合 System.Reflection.RuntimeMethodInfo.Invoke(Object obj、BindingFlags invokeAttr、バインダーバインダー、オブジェクト[]パラメーター、CultureInfoカルチャ) at System.RuntimeType.InvokeMember MForms.ScriptManagerM3.RunScriptの (type scriptType、ControlScript)でSystem.RuntimeType.InvokeMember(String name、BindingFlags bindingFlags、バインダーバインダー、オブジェクトターゲット、ObjectArgs、ParameterModifier []修飾子、CultureInfoカルチャ、String [] namedParams) controlScript、Mango.UI.Script.ScriptToolControl.RunでオブジェクトrunContext、IScriptDebugOutput scriptDebugOutput) ()

コードスニペットは

import System; 
import System.Windows; 
import System.Windows.Controls; 
import MForms; 
import Mango.UI; 
import Mango.UI.Core; 
import Mango.UI.Core.Util; 
import Mango.UI.Services; 
import System.Collections.Generic; 
import System.Collections; 

package MForms.JScript { 
    class ValidateField { 
     var controller; 
     var debug; 
     var value; 
     var textBoxlotref1Element; 
     var max; 
     var min; 

     public function Init(element : Object, args : Object, controller : Object, debug : Object) { 
      var content : Object = controller.RenderEngine.Content; 
      this.textBoxlotref1Element =ScriptUtil.FindChild(content, "WLBREF"); 

      textBoxlotref1Element.add_Click(testMethod); 
     } 

     public function testMethod(sender: Object, e: EventArgs) { 

     } 
    } 
} 

である私はJScriptのに初心者です。私はどこかで簡単なステップを欠いていると思う。

ありがとうございました!

答えて

0

これを試してください。

function ButtonEventHandler1(sender, e : EventArgs) 
{ 
    MessageBox.Show("Event is Fired!"); 
} 
+0

こんにちは、動作しません。実行時例外は、イベントが発生する前にスローされます。クリックイベントが付加される前でも。 – janindu

関連する問題