Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7048901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:56:51+00:00 2026-05-28T02:56:51+00:00

I have added Two Factor Authentication to my Mobile ASP.Net Web App. When the

  • 0

I have added Two Factor Authentication to my Mobile ASP.Net Web App. When the user successfully enters their User Name and Password then a pin number is emailed to their email address which is stored in the database. The issue I am having is that after notifying the user that they don’t have an email defined and then reload the login page but my code isn’t notifying the user rather it is just reloading the Login.aspx page:

Private Sub GeneratePin()
    Dim r As New Random(System.DateTime.Now.Millisecond)
    _Pin = CStr(r.Next(1000, 99999))
    _email = CIAppGlobals.CurrentUser.UsrContactEmail

    With lblPin
        .Text = "PIN has been emailed to the you please check your email now."
    End With

    If Not String.IsNullOrEmpty(_email) Then
        Dim Message As String = " Your Mobile PIN number is " & _Pin & vbNewLine & "From IP Address: " & CIAppGlobals.AppSettings.ClientIP

        Tools.SendEmail(CIAppGlobals.CurrentUser.UsrContactEmail, "Mobile App - Two Factor Authentication", Message)

    Else
        Dim sText As String = "Please contact the Administrator You do not have an email address defined within Application."
        'DirectCast(HttpContext.Current.Handler, System.Web.UI.Page).ClientScript.RegisterStartupScript(Me.[GetType](), "test", "alert('" & sText & "')", True)
        Response.Write("<script>alert('" & sText & "');</script>")
        Thread.Sleep(5000)

        'Session.Abandon()
        'FormsAuthentication.SignOut()

        Response.Redirect(ParentFolder & "/Login.aspx")
    End If

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:56:52+00:00Added an answer on May 28, 2026 at 2:56 am

    Your call to Response.Redirect() is causing anything you output not to be displayed. You need to remove that, then output a link or some javascript to go to the login page.

    Also: you need to remove the call to Thread.Sleep(). That is causing a needless delay and keeping an asp.net thread busy doing nothing. It’s not doing what you think it is…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added two user control to the project. One is for portrait and
I have created a web application in that application i have added two folder.
I have developed MVC web app. Now, I want to use custom form authentication
I have a machine with VmWare installed which added two extra network interfaces. The
I have a program with two TForm classes and have added a TMainMenu to
I have a gridview that displays items details, I added two template fields one
I have added two modules in my drupal site called.... 1. me alias 2.
I have added two pages through admin side(About us, privacy policy) How can i
I have added two update panels to my page. I'm trying to update the
I have a WiX installer project where I have added two firewall exceptions as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.