PrivateSub 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:
<FONT style="BACKGROUND-COLOR: #ffff00"><FONT style="BACKGROUND-COLOR: #ffffff"></FONT><FONT style="BACKGROUND-COLOR: #ffff00"> PrivateSub Page_Load()Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load 'Put user code to initialize the page here IfNot IsPostBack Then '如果是Quesring是这样 'Dim ENname as string = Request.QueryString["E"] Dim EName AsString Dim EAddress AsString Dim EProvice AsString Dim ECity AsString 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") EndIf End Sub</FONT></FONT>