-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLayout.Master.vb
More file actions
34 lines (31 loc) · 1.35 KB
/
Copy pathLayout.Master.vb
File metadata and controls
34 lines (31 loc) · 1.35 KB
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
Imports System.Data
Imports System.Data.SqlClient
Public Class Layout
Inherits System.Web.UI.MasterPage
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("Customer") <> "" Then
hlLogin.Visible = False
hlLogout.Visible = True
lblCustomer.Text = Session("Customer")
lblCustomer.Visible = True
End If
End Sub
Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
If tbSearch.Text <> "" Then
Dim strURL As String = ""
' check the number of works in the textbox
Dim strCheck As String = " "
If Not Trim(tbSearch.Text).Contains(strCheck) Then
' check if there is a match in the Product table
' all the database objects declared and instantiated
' Dim strSQL As String = "Select * from Product Where ProductID = '" & Trim(tbSearch.Text) & "'"
' assign a dynamic value for strURL
strURL = "Category.aspx?SearchString=" & Trim(tbSearch.Text)
Response.Redirect(strURL)
Else
strURL = "Category.aspx?SearchString=" & Trim(tbSearch.Text)
Response.Redirect(strURL)
End If
End If
End Sub
End Class