如何将数据传递到服务器并将页面重定向到下一个内容页面,因为我的控件和数据来自母版页?

时间:2013-10-31 12:30:49

标签: c# asp.net

我在母版页和一个Imagebutton中选择了五个下拉列表。 单击图像按钮下拉列表的值将传递到服务器端进行处理,结果将显示在另一个内容页面上。

1 个答案:

答案 0 :(得分:0)

使用可以使用Session变量,如下所示:

首先使用值

启动Session变量
Session["variablename"] = value //can be int, string, datatable, array etc

在其他页面上使用

getvalue = Session["variablename"].ToString() //if the value is string type (or convert it accordingly)

如果Session变量的使用结束,则将其转储。

Session.Remove("variablename");