发送(a.aspx): Response.Redirect("b.aspx?ID=123");接收(b.aspx): int ID = -1; if (Request.QueryString["ID"] != null) { ID = int.Parse(Request.QueryString["ID"]); }
或者 Server.Transfer("b.aspx?ID=123"); int ID = -1; if (Request["ID"] != null && Request["ID"] != string.Empty) { ID = int.Parse(Request.QueryString["ID"]); }
Response.Redirect("b.aspx?ID=123");接收(b.aspx):
int ID = -1;
if (Request.QueryString["ID"] != null)
{
ID = int.Parse(Request.QueryString["ID"]);
}
Server.Transfer("b.aspx?ID=123");
int ID = -1;
if (Request["ID"] != null && Request["ID"] != string.Empty)
{
ID = int.Parse(Request.QueryString["ID"]);
}
一般有通过session,application,cookie,以及上面的参数传值.
还有通过实体类也可以达到传值的作用!
http://xj520zq.web19.hzfwq.com/e_tech/aspx/2006-06-15/5027.htmlhttp://zhidao.baidu.com/question/5453145.html