复制代码 代码如下:
private void Button1_Click(object sender, System.EventArgs e)
{
string s_url;
s_url = "b.aspx?name=" + Label1.Text;
Response.Redirect(s_url);
}
复制代码 代码如下:
private void Page_Load(object sender, EventArgs e)
{
Label2.Text = Request.QueryString["name"];
}
复制代码 代码如下:
private void Button1_Click(object sender, System.EventArgs e)
{
Application["name"] = Label1.Text;
Server.Transfer("b.aspx");
}
复制代码 代码如下:
private void Page_Load(object sender, EventArgs e)
{
string name;
Application.Lock();
name = Application["name"].ToString();
Application.UnLock();
}
复制代码 代码如下:
private void Button1_Click(object sender, System.EventArgs e)
{
Session["name"] = Label.Text;
}
复制代码 代码如下:
private void Page_Load(object sender, EventArgs e)
{
string name;
name = Session["name"].ToString();
}
复制代码 代码如下:
private void Button1_Click(object sender, System.EventArgs e)
{
HttpCookie cookie_name = new HttpCookie("name");
cookie_name.Value = Label1.Text;
Reponse.AppendCookie(cookie_name);
Server.Transfer("b.aspx");
}
复制代码 代码如下:
private void Page_Load(object sender, EventArgs e)
{
string name;
name = Request.Cookie["name"].Value.ToString();
}
复制代码 代码如下:
public string Name
{
get{ return Label1.Text;}
}
private void Button1_Click(object sender, System.EventArgs e)
{
Server.Transfer("b.aspx");
}
复制代码 代码如下:
private void Page_Load(object sender, EventArgs e)
{
a newWeb; //实例a窗体
newWeb = (source)Context.Handler;
string name;
name = newWeb.Name;
}
复制代码 代码如下:
<form action="default.aspx" method="post" enctype="application/x-www-form-urlencoded">
<label>xm
<input type="text" value="xiaoqi" />
</label>
<label><br />
xb
<input type="text" value="nan" />
</label>
<p>
<input type="submit" value="send" />
</p>
</form>
//获取客户端参数(post)2
this.Response.Write("<br/>" + this.Request.Form["xm"]);
this.Response.Write("<br/>" + this.Request.Form["xb"]);
this.Response.Write("<br/>请求类型:" + this.Request.RequestType);
this.Response.Write("<br/>从客户端读取POST成功!");
新闻热点
疑难解答
图片精选