没分了,还请大家一样解答我的问题--有关Javascript?

GXY2005 2006-10-24 09:59:03
function requestCustomerInfo()
{
  var sId = document.getElementById("txtCustomerId").value;
  top.frames["hiddenFrame"].location = "getcustomerdata.aspx?id=" + sId;
}
以上Javascript代码如何用C#代替??Page.Parent.FindControl("hiddenFrame")???我请教大家了!
...全文
92 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
GXY2005 2006-10-24
  • 打赏
  • 举报
回复
问题解决,非常感谢大家,也来Csdn一年多了,真是受益非浅啊!谢谢众兄弟帮助我
Knight94 2006-10-24
  • 打赏
  • 举报
回复
to 问题是top.frames["hiddenFrame"].location 怎么转换过来?写代码出来我就明白了

读取txtCustomerId中的数据,我就不说了,

至于后者,你可以如下试试
Response.Write("<script language=javascript>top.frames['hiddenFrame'].location = 'getcustomerdata.aspx?id=" + sId + "';</script>" );
GXY2005 2006-10-24
  • 打赏
  • 举报
回复
感谢csShooter(Sharp Shooter) ( ) 信誉:100 Blog
我实验下!
GXY2005 2006-10-24
  • 打赏
  • 举报
回复
我是想把隐藏桢实现无刷新利用c#实现,以前都是用Javascript.感谢!我要用C#访问Frame好象不可以?
csShooter 2006-10-24
  • 打赏
  • 举报
回复
top.frames["hiddenFrame"].location 怎么转换过来?
-----------------------------------------------------

不用转换!还是按javascript输出到页面,如:

Response.Clear();
Response.WriteLine("<script>top.frames[\"hiddenFrame\"].location =\"getcustomerdata.aspx?id=\"" + txtCustomerId.Text + "</script>");
GXY2005 2006-10-24
  • 打赏
  • 举报
回复
服务器控件好象没有Frame这个东西,top.frames自然不存在了?那就是说不能转换了?那位知道的指教下?
GXY2005 2006-10-24
  • 打赏
  • 举报
回复
问题是top.frames["hiddenFrame"].location 怎么转换过来?写代码出来我就明白了
Knight94 2006-10-24
  • 打赏
  • 举报
回复
你把txtCustomerId这个control的runat设为server,就可以直接访问。

110,532

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧