源代码
By  wanghfyangy 发表于 2007/7/30 21:21:00 


<FONT style="BACKGROUND-COLOR: #ffff00">    <FONT style="BACKGROUND-COLOR: #ffff00">

Private 
Sub ImageButton1_Click()Sub ImageButton1_Click(ByVal sender As System.ObjectByVal 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"> 


Private 
Sub Page_Load(ByVal sender As System.ObjectByVal 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>
 
阅读全文 | 回复(0) | 引用通告 | 编辑 | 收藏该日志

发表评论:

    昵称:
    密码:
    主页:
    标题:

 
站点公告
站点日历
最新日志
最新评论
最新留言
友情链接
站点统计
日志搜索
用户登陆