1:response.redirect(跳转页.aspx?name="tom"&age="18")
在跳转页中request["name"] request["age"];
2:cookie,session, aplication;
3:ashx文件通过action指定跳转页传送数据,设置name和value,value是搜索的内容
4:将page1.aspx窗体和所有控件值传给另一个页面page2.aspx
page1(aspx文件)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="page1.aspx.cs" Inherits="页面跳转传送数据.page1" %>
<!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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" Enabled="True" PostBackUrl="~/page2.aspx" />
</div>
</form>
</body>
</html>
page2cs文件
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace 页面跳转传送数据
{
public partial class page2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (PreviousPage!=null)
{
TextBox mttxt = PreviousPage.FindControl("TextBox1") as TextBox;
if (mttxt != null)
{ Label1.Text = mttxt.Text;}
}
}
}
}