a.aspx父页   b.aspx弹出页   c.asp修改页面 
这样从父页的DataList中传递值到b.aspx已经解决 现在我想实现点击b.aspx上的修改按钮 然后a.aspx转向到c.aspx 且b.aspx关闭 需要的值由b.aspx传递到c.aspx
我在b.aspx中写的转向代码如:
   protected void GoToUpDatePage_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request.QueryString["nid"]); //Convert.ToInt32(Request.QueryString["nid"]); 是从a.aspx中传过来的,相应要传递到c.aspx以便处理
        Response.Write("<script>" + "opener.location.href=upDateNews.aspx?nid="+"id" + "self.close();" + "</" + "script>");
    }
我这样的实现没有反映,请赐教

解决方案 »

  1.   

    看得有点晕
    建议把js写在a页面,B页面确认后给a的JS传个参数,在A里关闭B,然后跳转到C
      

  2.   

    这些操作通过HTML就可以完成,无需用到服务器代码
      

  3.   

     int   id   =   Convert.ToInt32(Request.QueryString["nid"]);   
    把给id 赋值 放到pageload 里,
    int id ;放在页内定义.
      

  4.   

    改你的
    Response.Write("<script>opener.location.href='upDateNews.aspx?nid="+id+"'; self.close();</script> "); 前台的
    <script>
    window.opener.location.href="upDateNews.aspx?nid="+Request.QueryString["nid"];
    self.close();"
    </script> 
    父子窗体是可以直接传参数的,无需Request.QueryString["nid"]
      

  5.   

    Sandy945感谢回复 你说的什么意思 我不是很明白 最好给点代码
      

  6.   

    Response.Write(" <script> window.opener.location.href='upDateNews.aspx?nid="+id+"';   self.close(); </script>");   <script> 
    window.opener.location.href="upDateNews.aspx?nid="+<% =Request["nid"]%>; 
    self.close();
    </script>   
    今天老是打错...
      

  7.   

    你说的前台是b.aspx? 你的代码放在哪哦
      

  8.   

    A,弹出B(模态窗口),在B处理完毕后,关闭,返回A(可带返回值),然后从A,转到C,应该不难吧
      

  9.   

    可以用两个Panel,这样只要一个页面就行了.根据地址中的参数动态加载其中一个Panel的内容,数据传递当然也就不是问题了
      

  10.   

    @superdanpi 你的代码      protected   void   GoToUpDatePage_Click(object   sender,   EventArgs   e) 
            { 
                    int   id   =   Convert.ToInt32(Request.QueryString["nid"]);   //Convert.ToInt32(Request.QueryString["nid"]);   是从a.aspx中传过来的,相应要传递到c.aspx以便处理 
                    Response.Write(" <script> "   +   "opener.location.href=upDateNews.aspx?nid="+"id"   +   "self.close();"   +   " </"   +   "script> "); 
            } 应该为      protected   void   GoToUpDatePage_Click(object   sender,   EventArgs   e) 
            { 
                    string    id = Request.QueryString["nid"] == null ? string.Empty : Request.QueryString["nid"];
    //Convert.ToInt32(Request.QueryString["nid"]);   是从a.aspx中传过来的,相应要传递到c.aspx以便处理 
    //因为id 你还是要当参数 传 所以可以先不转换,到upDateNews 页在转换.
                    Response.Write(" <script> "   +   "opener.location.href='upDateNews.aspx?nid="+id   +   "';self.close();"   +   " </"   +   "script> "); 
            } id 已经是变量了,双引号应该去掉
    还一个地方是href 属性需要有括号(单,双都可)
    eg: opener.location.href='upDateNews.aspx?nid=1'
    你没写括号.
    相临语句要有结束标识 ;
    你这回试一下