forked from ventrian/Simple-Gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearchBox.ascx.vb
executable file
·65 lines (40 loc) · 1.75 KB
/
SearchBox.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Imports DotNetNuke.Common
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Namespace Ventrian.SimpleGallery
Partial Public Class SearchBox
Inherits SimpleGalleryBase
#Region " Private Methods "
Private Sub BindBreadCrumbs()
ucGalleryMenu.AddCrumb(Localization.GetString("AllAlbums", LocalResourceFile), NavigateURL())
ucGalleryMenu.AddCrumb(Localization.GetString("Search", LocalResourceFile), NavigateURL(Me.TabId, "", "SearchID=" & TabModuleId))
End Sub
#End Region
#Region " Event Handlers "
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
If (GallerySettings.EnableSearch = False) Then
Response.Redirect(NavigateURL(), True)
End If
BindBreadCrumbs()
If (Page.IsPostBack = False) Then
txtSearch.Focus()
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
#Region " Event Handlers "
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click
Try
If (txtSearch.Text <> "") Then
Response.Redirect(NavigateURL(Me.TabId, "", "SearchID=" & TabModuleId, "SearchText=" & Server.UrlEncode(txtSearch.Text)), True)
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
End Class
End Namespace