Click here to Skip to main content
15,886,689 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Email Based OTP Verification for new user registration Pin
Richard Deeming21-May-19 0:37
mveRichard Deeming21-May-19 0:37 
QuestionCannot insert the value NULL into column 'Status_Id', table 'ITInventory.dbo.Workstations'; column does not allow nulls. INSERT fails. Pin
SuperJWP20-May-19 7:32
SuperJWP20-May-19 7:32 
AnswerRe: Cannot insert the value NULL into column 'Status_Id', table 'ITInventory.dbo.Workstations'; column does not allow nulls. INSERT fails. Pin
Richard Deeming20-May-19 8:43
mveRichard Deeming20-May-19 8:43 
QuestionAjax ToolKit File Upload CAN NOT upload AutoCAD files Pin
Member 1253746817-May-19 11:33
Member 1253746817-May-19 11:33 
AnswerRe: Ajax ToolKit File Upload CAN NOT upload AutoCAD files Pin
Richard Deeming21-May-19 0:39
mveRichard Deeming21-May-19 0:39 
Questionkeep web form drop down list from chagning Pin
dcof16-May-19 10:09
dcof16-May-19 10:09 
AnswerRe: keep web form drop down list from chagning Pin
User 418025428-May-19 10:41
User 418025428-May-19 10:41 
QuestionRedirecting a user (vb.net) Pin
Member 876166712-May-19 23:22
Member 876166712-May-19 23:22 
Hello

I am working my way through Microsoft's WebFormsIdentity template. In the template, the login.aspx page has this:


VB
<pre>Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

          RegisterHyperLink.NavigateUrl = "Register"
        ' Enable this once you have account confirmation enabled for password reset functionality
        ' ForgotPasswordHyperLink.NavigateUrl = "Forgot"
        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 = 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
End Class


In that second Protected Sub under Select Case, can I comment out this line


VB
IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)


to redirect the user instead to my userpage.aspx page, something like


Response.Redirect("Userpage.aspx")


Thanks!
AnswerRe: Redirecting a user (vb.net) Pin
Richard Deeming13-May-19 8:02
mveRichard Deeming13-May-19 8:02 
GeneralRe: Redirecting a user (vb.net) Pin
Member 87616679-Jun-19 23:56
Member 87616679-Jun-19 23:56 
QuestionEncountering error 401 1 2148074254 while accessing the webservice in NLB environment Pin
vinod koti7-May-19 3:22
vinod koti7-May-19 3:22 
QuestionData Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 3:14
samflex3-May-19 3:14 
AnswerRe: Data Reader only producing one row of records. Any ideas why? Pin
Richard Deeming3-May-19 3:29
mveRichard Deeming3-May-19 3:29 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 3:51
samflex3-May-19 3:51 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
Richard Deeming3-May-19 5:27
mveRichard Deeming3-May-19 5:27 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 7:06
samflex3-May-19 7:06 
AnswerRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx3-May-19 9:18
professionaljkirkerx3-May-19 9:18 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex3-May-19 9:51
samflex3-May-19 9:51 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx3-May-19 10:16
professionaljkirkerx3-May-19 10:16 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx3-May-19 10:34
professionaljkirkerx3-May-19 10:34 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex10-May-19 4:39
samflex10-May-19 4:39 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx10-May-19 8:22
professionaljkirkerx10-May-19 8:22 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex10-May-19 10:31
samflex10-May-19 10:31 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
jkirkerx12-May-19 13:15
professionaljkirkerx12-May-19 13:15 
GeneralRe: Data Reader only producing one row of records. Any ideas why? Pin
samflex16-May-19 14:39
samflex16-May-19 14:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.