超级难题!ajax, getelementbyid 失效 用JS的document.getElementById 应该可以取到的,但是用AJAX服务器端 确实取不到服务器控件,你是在哪 怎么取的TEXTBOX,能不能说的详细点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该不是bug,lz请仔细检查下html,是否真的存在。 我使用服务器端控件和 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控件,都不行 VS2005服务器端控件应该是:document.getElementById("<%ruby.ClientID%>").value="dfdfdf";还有如果是子页面想访问父页面的控件,那么试试window.opener.document.getElementById("<%ruby.ClientID%>").value="dfdfdf";//这个地方不知道写对了没有.LZ,google或者baidu以下window.opener吧 document.getElementById("<%ruby.ClientID%>").value="dfdfdf";这样子会报错,缺少; 用ASP做过。也用纯HTML做过。楼主先不要用c#写,就用纯HTML测试。不是AJAX的BUG! 怎么循环得到资源文件里面的图片啊 急!!C# winform窗体编程中 textBox与键盘监听冲突问题 帮我参考下这个架构可以承载多少访问量 【新手问题】执行命令行程序时、万一出现了等待输入的提示、怎么获取输出信息 求助asp.net 和sqlserver 求助!case …… when …… then …… else …… end c#指针问题 excel中添加一个sheet,其位置在最后 网络问题 怎么样写事件来知道DateTimePicker中的年、月、日、时、分等时间文本区域被选中了? 求解决一条简单的SQL语句 在线等 马上散分 获取星期的函数(c sharp)
弹出页面: #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控件,都不行
还有
如果是子页面想访问父页面的控件,那么试试
window.opener.document.getElementById("<%ruby.ClientID%>").value="dfdfdf";
//这个地方不知道写对了没有.LZ,google或者baidu以下window.opener吧
缺少;