No announcement yet.

VB.NET Login form 'standing still'

  • Filter
  • Time
  • Show
Clear All
new posts

  • VB.NET Login form 'standing still'


    I have a Login.aspx form in an ASP.NET (VB) project which does not work. I do not get any errors but when the correct username and password are typed into the form fields, the form just 'stands still'.

    Here is my code:

    Partial Public Class Account_Login
        Inherits Page
        Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
            RegisterHyperLink.NavigateUrl = "Register"
            OpenAuthLogin.ReturnUrl = Request.QueryString("ReturnUrl")
            Dim returnUrl = HttpUtility.UrlEncode(Request.QueryString("ReturnUrl"))
            If Not [String].IsNullOrEmpty(returnUrl) Then
                RegisterHyperLink.NavigateUrl += "?ReturnUrl=" & returnUrl
            End If
        End Sub
    Protected Sub LogIn(sender As Object, e As EventArgs) Handles btnLogin.Click
        If IsValid Then             ' Validate the user password             
            Dim manager = New UserManager()
            Dim user As ApplicationUser = manager.Find(username.Text, password.Text)
                If user IsNot Nothing Then
                    IdentityHelper.SignIn(manager, user, RememberMe.Checked)
                    IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)
                End If
            Catch ex As Exception
                    FailureText.Text = ex.Message 'Should show the actual error line
                ErrorMessage.Visible = True
            End Try
        End If
    End Sub
    End Class
    Shouldn't this script show a SQL 'SELECT FROM' username/password for it to validate that the user exists in the database (MS Access), and doesn't it need to point to a URL or other file that directs the user after his login credentials have been verified (in this particular case it is a Web address that lies outside my ASP.NET project).

    Thank you.

  • #2
    You are seeing identity 2.0 interfaces. They are implemented using generics as .net calls them (Active Template Library in C++). It is also using Extension Methods that combined data based on the underlying type. If you browse to the App_Code folder (maybe models it depends) and it should have a file named "IdentityModel.cs" which contains a portion of the implementation that executes.
    Red GateSQL tools for DBA