C#/.net中页面如何获取前一页面的label.text的值?

来源:百度知道 编辑:UC知道 时间:2024/05/28 12:48:48
如题...用什么方法传值好呢?
不止一个label怎么办?

session

session

不知道你传的值做什么用
一般传值都是最要紧的数据
然后到另一个页面再通过传递过来值做查询

可以用session,也可以在地址栏里传参数,或者是写cookie

将label.text的值赋值给一个变量,然后将作为变量页面间的参数进行传递,或者直接使用session。

可以用session
如 session["label"]="xxxxxx";
在另外的页面就直接用~

或者用传值的方式
this.ClientScript.RegisterStartupScript(typeof(int), "1", "<script language=javascript> showModalDialog(xxxxxxx.aspx?mode=new&afa_rnd=" + random.Next().ToString() + "',window,'dialogHeight:560px;dialogWidth=726px;edge: Raised; center: yes; help: no; resizable: no; status: no;self.location.href=self.location.href;');</script>");

在xxxxxxx.aspx页面用
Request["mode"].ToString();就可以取到值了
就可以取到mode=new这个值了
多个用&分开就好~

用session或定义静态变量