用JS的document.getElementById 应该可以取到的,但是用AJAX服务器端 确实取不到服务器控件,你是在哪 怎么取的TEXTBOX,能不能说的详细点

解决方案 »

  1.   

    应该不是bug,lz请仔细检查下html,是否真的存在。
      

  2.   

    我使用服务器端控件和 html控件都试验过,没有成功。
    弹出页面:    #region GridView_RowDataBound
        protected void GridView_RowDataBound(object sender, GridViewRowEventArgs args)
        {
            if (args.Row.RowType == DataControlRowType.DataRow)
            {
                Customer cust = (Customer)args.Row.DataItem;
                HyperLink lnk = (HyperLink)args.Row.FindControl("lnkCustomerEdit");
                lnk.NavigateUrl = "";
                lnk.Text = cust.CustomerName;            ////chang the color
                //args.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';this.style.color='#003399'");
                //args.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#6699FF';this.style.color='#8C4510'");            args.Row.Attributes.Add("OnClick", "ClickEvent('" + args.Row.Cells[1].Text + "')");
                args.Row.Attributes["style"] = "Cursor:hand";
            }
        }
        #endregion为gridview添加了单击事件:
        <script language="javascript">        
    function ClickEvent(d)
    {
     window.opener.mytest();
    }
        </script>
    父页面:    <script language="javascript">        
    function mytest(d)
    {
            alert(d+"!!this is the setsethhh");
            document.getElementById("ruby").value="dfdfdf";
    }
        </script> 
    就是
    document.getElementById("ruby").value="dfdfdf";
    出的问题不管是服务器端控件还是html控件,都不行
      

  3.   

    VS2005服务器端控件应该是:document.getElementById("<%ruby.ClientID%>").value="dfdfdf";
    还有
    如果是子页面想访问父页面的控件,那么试试
    window.opener.document.getElementById("<%ruby.ClientID%>").value="dfdfdf";
    //这个地方不知道写对了没有.LZ,google或者baidu以下window.opener吧
      

  4.   

    document.getElementById("<%ruby.ClientID%>").value="dfdfdf";这样子会报错,
    缺少;
      

  5.   

    用ASP做过。也用纯HTML做过。楼主先不要用c#写,就用纯HTML测试。不是AJAX的BUG!