Hello
In Visual Studio 2013 I have a small (two form) vb.net project. My 'new user' form inserts field form data in my MS Access database, and I have created a page that thanks the user for registering. The other form, Login.aspx is then supposed to log in this new user.
However, when I complete the log-in credentials correctly and press the 'OK' button, nothing happens: the username remains in its field and the password disappears. I don't get any errors when debugging, or 'Invalid username/password' after pressing 'OK'.
Ideally, the user who inputs log-in credentials correctly, should be sent to an external Classic ASP site which is already being hosted (I say external because I am only testing my ASP.NET project locally, and the external Classic site is not part of this project in Visual Studio at all). Is my log-in form static/doing nothing because I have not referenced that external site? This is the Login.aspx.vb script that I have at the moment:
There is no 'SELECT FROM......' or reference to my database path here, either, as there would be in Classic ASP.
What should I be adding to the above, please?
Thanks
Blueie
In Visual Studio 2013 I have a small (two form) vb.net project. My 'new user' form inserts field form data in my MS Access database, and I have created a page that thanks the user for registering. The other form, Login.aspx is then supposed to log in this new user.
However, when I complete the log-in credentials correctly and press the 'OK' button, nothing happens: the username remains in its field and the password disappears. I don't get any errors when debugging, or 'Invalid username/password' after pressing 'OK'.
Ideally, the user who inputs log-in credentials correctly, should be sent to an external Classic ASP site which is already being hosted (I say external because I am only testing my ASP.NET project locally, and the external Classic site is not part of this project in Visual Studio at all). Is my log-in form static/doing nothing because I have not referenced that external site? This is the Login.aspx.vb script that I have at the moment:
Code:
Imports Microsoft.AspNet.Identity
Imports Microsoft.AspNet.Identity.EntityFramework
Imports Microsoft.AspNet.Identity.Owin
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports Microsoft.Owin.Security
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)
' 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)
' Else
' FailureText.Text = "Invalid username or password."
' ErrorMessage.Visible = True
' End If
' End If
' End Sub
'End Class
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)
Try
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 'this should pump out the actual error line from the stack trace.
ErrorMessage.Visible = True
End Try
End If
End Sub
End Class
There is no 'SELECT FROM......' or reference to my database path here, either, as there would be in Classic ASP.
What should I be adding to the above, please?
Thanks
Blueie