Public MustInherit Class SearchModule
Inherits System.Web.UI.UserControl
Protected WithEvents SearchDropDownList As System.Web.UI.WebControls.DropDownList
Protected WithEvents SearchTextBox As System.Web.UI.WebControls.TextBox
Protected WithEvents SearchButton As System.Web.UI.WebControls.Button
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
End Sub
Public Sub SearchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchButton.Click
Dim Url As String
Url = "search.aspx?searchType="
Select Case SearchDropDownList.SelectedItem.Text
Case "按书名"
Url &= "Name"
Case "按作者"
Url &= "Author"
Case "按主题"
Url &= "Subject"
End Select
Url &= "&searchText="
Url &= SearchTextBox.Text
Response.Redirect(Url)
End Sub
End Class