根据用户条件,组合成查询表达式,高手帮我看一下
搜索按钮的代码:(将参数传如到ArticlesList.aspx中去)
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
Dim str As String
str = "akinds= " & dropdownlist1.SelectedValue
str += "infor= " & textbox1.Text
str += "seekid= " & dropdownlist2.SelectedValue
Response.Redirect( "articleslist.aspx? " & str)
End Sub
ArticlesList.aspx中的部分代码:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Not Page.IsPostBack Then
viewstate( "pagenow ") = 0
Dim akinds As String = Request.Params( "akind ")
Dim seekid As String = Request.Params( "seekid ")
Dim infor As String = Request.Params( "infor ")
Dim moreid As String = Request.Params( "moreid ")
If moreid = " " Then
If akinds = " " Or seekid = " " Or infor = " " Then
Response.Redirect( "default.aspx ")
Else
If akinds = "-1 " Then
mysql = " where " + seekid + " like '% " + infor + "% ' "
Else
mysql = " where akinds= " + akinds + " and " + seekid + " like '% " + infor + "% ' "
End If
End If
Else
mysql = " where akinds= " + Request.Params( "moreid ")
End If
getdatainfor()
getdata()
End If
End Sub
我的问题出在哪里啊?为什么点击按钮没有反应的
高手帮忙看看啦
谢谢!
------解决方案--------------------是不是事件丢失了
------解决方案--------------------Response.Redirect( "articleslist.aspx?id= "+str) c#的写法
------解决方案--------------------设置段点,看下mysql的值:
(在getdatainfor()行 上面设置)