<!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);
}
解决方案 »
- 怎么在页面得到参数并且直接显示出来
- session默认超时时间是多少?可以在程序中对超时时间进行设置么?
- 初学ASP.NET
- Repeater控件中怎么交互动作,一个隐藏另一个显示。
- 项目部署虚拟服务器问题
- 100分,My97日期控件My97DatePicker4.0正式版(跨框架,跨浏览器,带时间,自定义格式,多语言,日期限制,周显示,动态皮肤等),有详细演示和使用说明
- 我要疯了:ASP.NET中Javascript 对象不支持此属性或方法
- asp.net网站 整站商品实现模糊查询
- LinkButton行ImageButton报错.
- repeat 分页功能
- 能否实现文件夹同步功能
- 我在页面上有五个文本框,我想在输完最后一个文本框的内容以后,回车以后将五个文本框的内容都清空,并将焦点回到第一个文本框处
我的那个A页面,他也是一个asp.net页面
而他只能有一个form,form不能嵌套form
<%@ 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>
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。
这不禽兽行为
4:URL 这个是最好的,但我这里不允许用这个 不能在URL中出现参数
那就在外面套一个ifram窗体,内容就一个ifram ,这样的话不管你点什么,主ifram页不动,url也不变
比如中转页面是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页面做了。具体的靠你了。