Click here to Skip to main content
15,908,673 members

Comments by rlgentry (Top 7 by date)

rlgentry 24-Aug-20 15:19pm View    
I really didnt think that it mattered what my sql store proc is but to put it simply it would be
"select campusname, firstname, lastname from directory"

I would like to 'group' the firstname and lastname under the CampusName.
I decided I need 2 for loops but I only get the last record.


Code is
Dim campusname As Label = DirectCast(staff.Items(0).FindControl("campusname"), Label)
For Each row In dt.Rows

campusnameCUrr = row("campusname")
campusname.Text = campusnameCUrr
For j As Integer = 0 To dt.Rows.Count - 1
campusname.Text = campusnameCUrr
campusNamePrev = dt.Rows(j)(10).ToString()
If campusname.Text = campusNamePrev Then

Exit For


End If

Next


Next
rlgentry 30-Jan-20 17:03pm View    
I am open to that, but what about the password security. I dont know how to hash the password.
rlgentry 30-Jan-20 10:13am View    
I got the confirm email to work correctly. Now my issues is the LogIn redirect. in this code

Protected Sub LogIn(sender As Object, e As EventArgs)
If IsValid Then
' Validate the user password
Dim manager = Context.GetOwinContext().GetUserManager(Of ApplicationUserManager)()
Dim signinManager = Context.GetOwinContext().GetUserManager(Of ApplicationSignInManager)()

' This doen't count login failures towards account lockout
' To enable password failures to trigger lockout, change to shouldLockout := True
Dim result = signinManager.PasswordSignIn(Email.Text, Password.Text, RememberMe.Checked, shouldLockout := False)

Select Case result
Case SignInStatus.Success
IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)
Exit Select
Case SignInStatus.LockedOut
Response.Redirect("/Account/Lockout")
Exit Select
Case SignInStatus.RequiresVerification
Response.Redirect(String.Format("/Account/TwoFactorAuthenticationSignIn?ReturnUrl={0}&RememberMe={1}",
Request.QueryString("ReturnUrl"),
RememberMe.Checked),
True)
Exit Select
Case Else
FailureText.Text = "Invalid login attempt"
ErrorMessage.Visible = True
Exit Select
End Select
End If
End Sub

Where do I change the ReturnUrl in

Case SignInStatus.Success
IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)
Exit Select
rlgentry 29-Jan-20 14:21pm View    
That worked! Thank you.
When I log in it sends me to the readymade page for ASP.net. I need to change the ReturnUrl in Page_Load of Login.vb but I cant find where that is set. Could you direct me?
rlgentry 29-Jan-20 13:53pm View    
Should mm.body have something in it? If so would it be
  manager.SendEmail(user.Id, "Confirm your account", "Please confirm your account by clicking <a href="">here</a>.

and do i remove that from the createuser_click method?