服务端的button是会出错的

解决方案 »

  1.   

    button.attribute.add("onclick","return functionname")
      

  2.   

    <script>
    function ShowLabel
    {
    document.all.Label1.innerText = getAbsLeft(document.all.floater); 
    document.all.Label2.innerText = getAbsTop(document.all.floater)
    return false;
    }
    </script>
    button.attribute.add("onclick","return ShowLabel")
      

  3.   

    好象还是有点问题this.Button1.Attributes.Add("onclick","document.all.Label1.innerText = getAbsLeft(document.all.floater); document.all.Label2.innerText = getAbsTop(document.all.floater)");未将对象引用设置到对象的实例。 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
      

  4.   

    还是有点问题
    在客户端:
    <script language="JavaScript">
    function ShowLabel()
    {
    document.all.Label1.innerText = getAbsLeft(document.all.floater); 
    document.all.Label2.innerText = getAbsTop(document.all.floater);
    return false;
    }
    </script>
    服务端:
    this.Button3.Attributes.Add("OnClick","Return ShowLabel()");
    点击button3的时候还是会提示缺少";"怪了
      

  5.   

    this.Button3.Attributes.Add("OnClick","Return ShowLabel();");在showlabel()后加;