如:
MaterialEdit.aspx
<asp:TextBox ID="txtColorFirst" runat="server" CssClass="txtChn" Width="60" oninput="SetColor(this,this.value)" onChange="SetColor(this,this.value)" />
<span>&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp; 
<a target="_blank" href="../Color/ColorListSelect.aspx?IDControl=txtColorFirst&NameControl=txtColorFirst">选择</a>ColorListSelect.aspx    <script type="text/javascript">
        function Select(ID, Name)
        {
            var IDControl = '<%= Request.QueryString["IDControl"] %>';
            var NameControl = '<%= Request.QueryString["NameControl"] %>';
            window.opener.document.getElementById(IDControl).value = ID;
            window.opener.document.getElementById(NameControl).value = Name;
            window.opener.document.getElementById(NameControl).change();
          
        }
    </script>在我的
window.opener.document.getElementById(NameControl).change();
提示:对像不支付此属性或方法
但在他本页面是没有问题的谢谢
window.opener.document.getElementById(NameControl).change();

解决方案 »

  1.   

    window.opener.document.getElementById(NameControl).onchange();
    行么?
      

  2.   

    window.opener.document.getElementById(NameControl).value = Name;
    这句成功吗?
      

  3.   

    try->
    <a href="#" onclick='window.open("../Color/ColorListSelect.aspx?IDControl=txtColorFirst&NameControl=txtColorFirst")'>选择</a>
      

  4.   

    try==>window.opener.SetColor(window.opener.document.getElementById(NameControl),Name);
      

  5.   

    调用onchange的关联函数可以
                var obj=window.opener.document.getElementById(NameControl);
                window.opener.SetColor(obj,obj.value);
      

  6.   

    MaterialEdit.aspx中
    <a target="_blank" href="ColorListSelect.aspx>
    打开的ColorListSelect.aspx没有openerMaterialEdit.aspx不是ColorListSelect.aspx的"上级"^_^
      

  7.   

    RE:
    var obj=window.opener.document.getElementById(NameControl);
    window.opener.SetColor(obj,obj.value);
    ---------------------------------------------
    我就是不想用这种方法啊!!!
    我想通过调用他的change方法谢谢
      

  8.   

    <asp:TextBox ID="txtColorFirst" runat="server" CssClass="txtChn" Width="60" oninput="SetColor(this,this.value)" onchange="SetColor(this,this.value)" />这样呢?
      

  9.   

    服务器端控件,这样引发它的onchange事件
                var obj=window.opener.document.getElementById(NameControl);
                obj.onchange.call(obj);