1、parent.leftFrame.aaa
2、top.document.frams("leftFrame").aaa
3、parent.frames["leftFrame"].aaa
例如:
<frameset cols="50%,50%">
<frame name=leftFrame src="about:<script>var aaa='123';</script>">
<frame name=rightFrame src="about:<input type=button value='Click here' onclick=alert(parent.leftFrame.aaa)>">
</frameset>

解决方案 »

  1.   

    dachun(达达) ,我是想把这个aaa赋给rightframe的某个变量啊,而且rightframe不能再进行一次button事件去获得这个值
      

  2.   

    top.frames['main'].x=document.all.TextBox1.value
      

  3.   

    没有试过,只想讨论一下,
    可在主框架中加属性public string x
    ,如果传回值再刷新的话,可以在x的set事件中处理
      

  4.   

    qiushuiwuhen(秋水无恨) ,我早就试过了,你的x好象只能是js里的变量,而我最好它能赋给全局变量啊
    mythus(云淡风清) ,你能具体点吗?
      

  5.   

    我是把这个aaa赋给rightframe的button,你可以把它赋给变量
      

  6.   

    Source Web Form---WebForm1:public string x
    {
    get
    {
    return TextBox1.Text;
    }
             set
    {
    xxxxxxxxxxxxxxx;
    }}call Server.Transfer. private void Button1_Click
    (object sender, System.EventArgs e)
    {
    Server.Transfer("Destination .aspx");
    }Destination Web Formprivate void Page_Load
    (object sender, System.EventArgs e)
    {
    //create instance of source web form
    WebForm1 wf1;
    //get reference to current handler instance
    wf1=(WebForm1)Context.Handler;
    Label1.Text=wf1.x;

    }
    以上代码实现从一个页面传递变量到另一个页面,我不知在目的页面中是否
    可以更新原页面的属性x,即调用x的set事件,没试过,仅供讨论
      

  7.   

    mythus(云淡风清) ,我试过了,问题在这里wf1=(WebForm1)Context.Handler;
    错误是:
    指定的转换无效。
      

  8.   

    >>>>主框架的变量呢
    client javascript 变量 or server side 变量?? after you change the value in the textbox like in the other post, call the FormID.submit() in 主框架
      

  9.   

    top.frames['main'].location='main.aspx?x='+document.all.TextBox1.value