发送页的CODE:
Private Sub ImageButton1_Click()Sub ImageButton1_Click()Sub ImageButton1_Click()Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
'通过Querystring传递参数或者session中
'下面这一段是用QueryString来传输的
'Dim Url As String
'Url = "../search/LocalTemp.aspx.aspx?&Search=ok"
'If txtEnterpriseName.Text <> "" Then
' Url = Url + "&E=" + txtEnterpriseName.Text
'End If
'If txtAddress.Text <> "" Then
' Url = Url + "&A=" + txtAddress.Text
'End If
'If DDLProvice.SelectedValue <> "选择省份" Then
' Url = Url + "&P=" + DDLProvice.SelectedValue
'End If
'If DDLCity.SelectedValue <> "选择城市" Then
' Url = Url + "$C=" + DDLCity.SelectedValue
'End If
'If Url = "../search/SingleDetailed.aspx?&Search=ok" Then
' '给出错误提示
'End If
'Response.Redirect(Url)
' 下面使用session 传递
Session("E") = txtEnterpriseName.Text
Session("A") = txtAddress.Text
Session("P") = DDLProvice.SelectedValue
Session("C") = DDLCity.SelectedValue
'Server.Transfer()
Response.Redirect("../search/LocalTemp.aspx")
End Sub
</FONT> </FONT>
接受页的CODE:
Private Sub Page_Load()Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
'如果是Quesring是这样
'Dim ENname as string = Request.QueryString["E"]
Dim EName As String
Dim EAddress As String
Dim EProvice As String
Dim ECity As String
EName = Session("E").ToString
EAddress = Session("A").ToString
EProvice = Session("P").ToString
ECity = Session("C").ToString
'----
'your code
'-----
'When you use finish
Session.Remove("E")
Session.Remove("C")
Session.Remove("A")
Session.Remove("P")
End If
End Sub</FONT></FONT>