项目需求,一共有三个页面,A.ASPX;B.ASPX;C.ASPX
在A页面点击按钮后弹出一个B页面,焦点在B页面上,点击B页面上的按钮,打开C页面,并把B页面上的几个数值传送到C页面上。
我是这样操作的,在A页面上点击按钮后使用showModelessDialog调出B页面,在b页面点击按钮使用OPEN调出C页面,并使用Session传值。这种方法导致C页面无法接受到Session传来的值;
在A页面上点击按钮后使用open调出B页面,在b页面点击按钮使用OPEN调出C页面,并使用Session传值。这种方法C页面可以接受到Session传来的值,但是在打开B页面的时候,没有锁定焦点,也是不合要求。
请教各位高手,有没有更好的解决方法

解决方案 »

  1.   

    都用showModelDialog弹出窗口不就是了
      

  2.   

    Response。Redirect(“c.aspx?str=你要传送的参数”)//传送
    string str= RequestQuerString["str"];//接收
      

  3.   

    上面少个"."
    Response。Redirect(“c.aspx?str=你要传送的参数”)//传送
    string str= Request.QuerString["str"];//接收
      

  4.   

    我传送的是DataTable,QuerString传不了
      

  5.   

    谁知道showModelessDialog弹出的网页对话框如何向第三页面传送值
      

  6.   

    session传不过去么。?  应该可以吧?
    cookie呢?
      

  7.   

    传datatable!!!强悍,菜鸟意见
      

  8.   

    不是服务器跳转的话,应该要用url参数来传值吧
      

  9.   

    我也郁闷啊,用showModelessDialog弹出的网页对话框无法传值到第三页面,晕倒了
      

  10.   

    用Session来传DataTable可以改一下,传关键字到C页面再查询出来。SESSION在访问量大,服务器忙的时候会丢失的。
      

  11.   

    不止Session传送不了值,用QuerString也传送不了,是不是用showModelessDialog()打开网页对话框不能传送值到其他网页上去?
      

  12.   

    我再说明一下:
    我的A.aspx是主页面,通过showModelessDialog打开对话框B.aspx,(因为在打开B.aspx后需要不能操作A.aspx和B.aspx无法使用后退键)
    在B.aspx点击按钮时,需要打开c.aspx页面,并把b.aspx的数值传送过去。
      

  13.   

    你是不是session里的table查不到了?
      

  14.   

    你使用session传table的时候得小心点,table如果被dis掉了在其它页里是获取不到的。
      

  15.   

    同一个web项目里的页面?如果是的估计是session丢失的问题吧。
      

  16.   

    是中一个WEB的页面,奇怪的是如果我在A打开B的时候使用OPEN打开,B就能传值给C
      

  17.   

    将table保存到session中传,这种做法可取吗?
    你这种做法是错误的,实际开发不会这么干,
      

  18.   

    A.aspx
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>    <script language="javascript" type="text/javascript">
    // <!CDATA[        function Button1_onclick() {
                window.open("B.aspx");
            }        function Button2_onclick() {
                window.showModalDialog("B.aspx");
            }// ]]>
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
            <input id="Button1" type="button" value="Open" onclick="return Button1_onclick()" /><input id="Button2" 
                type="button" value="Show" onclick="return Button2_onclick()" /></div>
        </form>
    </body>
    </html>B.aspx
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>    <script language="javascript" type="text/javascript">
    // <!CDATA[        function Button1_onclick() {
                window.open("C.aspx?c=" + document.getElementById("Text1").value);
            }
            
    // ]]>
        </script>
    </head>
    <body onload='document.getElementById("Text1").value=opener?"Open":"showModalDialog"'>
        <form id="form1" runat="server" defaultfocus="Text1">
        <div>
        
            <input id="Text1" name="Text1" type="text" /><br />
        
            <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /></div>
        </form>
    </body>
    </html>B.aspx.cs
            Session["test"] = "OK";
            Response.Write("Session test:"+Session["test"].ToString());C.aspx.cs
            if (null != Session["test"])
            {
                Response.Write("Session test:"+Session["test"].ToString());
            }
            else
            {
                Response.Write("Session lost");
            }
            Response.Write("<br>");
            if (null != Request.QueryString["c"])
            {
                Response.Write("QueryString c:" + Request.QueryString["c"]);
            }
            else
            {
                Response.Write("QueryString lost");
            }