Tài liệu tham khảo - Code đăng nhập bằng | Code đăng nhập bằng (Thứ Ba, 29/12/2009-11:00 AM) Giao diện cùng code đăng nhập bằng . Còn dưới đây là code: quote: Imports Imports Partial Class Dangnhap Inherits Protected Sub Page_Load(ByVal sender As Object, ByVal e As ) Handles If ("Email") "" Then ("~/") End If End Sub Private Function ValidateUser(ByVal username As String, ByVal password As String) Dim cn As SqlConnection = Dim cmd As New SqlCommand("Select Count(*) From KhachHang Where Email=" & userName & " AND Matkhau=" & password & "", cn) Dim Count As Integer = Return Count 0 End Function Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As ) Handles If ValidateUser(, ) Then ("Email") = ("~/") End If End Sub End Class Imports Imports Partial Class Dangnhap Inherits Protected Sub Page_Load(ByVal sender As Object, ByVal e As ) Handles If ("Email") "" Then ("~/") End If End Sub Private Function ValidateUser(ByVal username As String, ByVal password As String) Dim cn As SqlConnection = Dim cmd As New SqlCommand("Select Count(*) From KhachHang Where Email=" & userName & " AND Matkhau=" & password & "", cn) Dim Count As Integer = Return Count 0 End Function Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As ) Handles If ValidateUser(, ) Then ("Email") = ("~/") End If End Sub End Class