现在的位置: 首页 > 综合 > 正文

功能强大的Server.Transfer

2012年11月17日 ⁄ 综合 ⁄ 共 467字 ⁄ 字号 评论关闭
Server.Transfer可以把页面上的一些数据传到其他的页面,而response.redirect只转入页面。

看看server。transfer的用法:

A:页面代码:
<input type='<%# type() %>' name="tp_id[]" id="tp_id[]" value='<%#Eval("id") %>' />
cs代码:
protected void ImageButton_tp_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
Server.Transfer("ROYcms_TP.aspx");
}

ROYcms_TP_aspx.cs中也可以处理来至a页面的所以数据的请求:
if (Request["tp_id[]"] != null)
{
tp_id_z = Request["tp_id[]"].Trim().Split(',');
}
if (Request["tp_id"] != null)
{
tp_id_z = Request["tp_id"].Trim().Split(',');
}

抱歉!评论已关闭.