<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>客户端</title>
</head>
<body>
<form id="form1" method="post" action="server.aspx">
    <input id="textput" name="textField"  type="text" />
    <input id="Submit" name="submit" type="submit" value="submit" />
</form>
</body>
</html>
===================================================================//服务端后台
    protected void Page_Load(object sender, EventArgs e)
    {
        string theData=Request.Form["textField"];
        Response.Write("textField="+theData);
    }

解决方案 »

  1.   

    上面个是htm页面。。下面个是server.aspx.cs
      

  2.   

    但问题是:
    我的那个A页面,他也是一个asp.net页面
    而他只能有一个form,form不能嵌套form
      

  3.   

    当使用 Transfer 方法或跨页发送在 ASP.NET 页之间传输处理时,发送页中包含目标页中可能需要的请求信息。可以使用 PreviousPage 属性访问该信息
    <%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">    protected void Page_Load(object sender, EventArgs e)
        {
            // If second is an even number, the server is available
            // Replace this line with a valid check for the server.
            bool IsServerAvailable = (DateTime.Now.Second % 2 == 0);        if (!IsServerAvailable)
                Server.Transfer("Notify.aspx", true);
        }
    </script><html  >
    <head runat="server">
        <title>Switch Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <h2>Database Server is Available</h2>    <p>This page appears if the database server 
            is available.</p>    <p>Enter a pretend Server Name: 
            <asp:TextBox ID="serverNameText" 
            runat="server">MyDatabaseServer</asp:TextBox>
        </p>    <p><asp:Button ID="SubmitButton" runat="server" 
            Text="Is server available?" /></p>
        </div>
        </form>
    </body>
    </html><%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">    protected void Page_Load(object sender, EventArgs e)
        {
            // Find the server name on the previous page
            TextBox txt = 
                    (TextBox)Page.PreviousPage.FindControl("serverNameText");
            if (txt != null)
                prevServerName.Text = Server.HtmlEncode(txt.Text);
            else
                prevServerName.Text = "[Name Not available]";
        }
    </script><html  >
    <head runat="server">
        <title>Page A</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <h2>Database Server is Not Available</h2>    <p>This page appears if the named database server is not 
        available, but the URL displays as the main target page.</p>    <p>Server Name (From Page.PreviousPage): 
            <asp:Label ID="prevServerName" runat="server" /></p>    <p>Refresh the page to see if the server is now available.</p>
        </div>
        </form>
    </body>
    </html>
      

  4.   

    办法如下:
    1. 使用Server.Transfer,这个比较合适。
    2. Session,比较简单。
    3. 还是URL,加个密。
    4. HttpRuntime.Cache,类似Applicataion,但可以设定过期条件。
    5. Application,方便。
    6. Cookie,不推荐。
    7. form提交,在另一页面使用Request.Form["xxxx"],方法比较传统。
    8. 用javascript,将A切到隐藏Frame中,然后把数据传给B,之后去掉A。
      

  5.   

    4:URL 这个是最好的,但我这里不允许用这个 不能在URL中出现参数 ?
    这不禽兽行为
      

  6.   

    form的post提交
    4:URL 这个是最好的,但我这里不允许用这个 不能在URL中出现参数 
    那就在外面套一个ifram窗体,内容就一个ifram ,这样的话不管你点什么,主ifram页不动,url也不变
      

  7.   

    最常用的4种方式被否了3个,其实用临时加密的cookie,安全性也足够高了,Forms验证的保存密码不也是用cookie的除此之外就只能Form提交得到了,不过在ASP.NET中Form不是特别方便
      

  8.   

    用openner.ID.value来从父页面获取值吧.甚至可以将某些值发送给父页面呢.很方便.
      

  9.   

    你可以做个中转页面。如下:
    比如中转页面是a.aspx如下:
    <body onload="onLoadData();">
        <form name="tologin" action="http://www.my968868.com/acc/accmember/memberLoginCheck.shtml?item=veIndex" method="post">
             <input type="hidden" name="hycompid" value="FJSLY" />
             <input type="hidden" name="item" value="veIndex">
             <input type="hidden" name="dlfs" value="1" >
             <input type="hidden" name="hyid" value='<%=Request.QueryString["u"] %>'>
             <input type="hidden" name="mm"  value='<%=Request.QueryString["p"] %>'>
             <input type="hidden" name="surl"  value="http://www.my968868.com/acc/ticket/searchTicket.shtml?lx=1&vitem=searchTicket&toforward=GNTICKET ">
        </form>
        <script type="text/javascript">
           document.tologin.submit();
        </script>
      </body>
    然后你在A页面直接指向a.aspx页面,通过a.aspx页面来把参数传到B页面。所要传的参数你就在a.aspx页面做了。具体的靠你了。