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 8839681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:17:33+00:00 2026-06-14T10:17:33+00:00

I have the following web pages: SecurityQuestion.cshtml @model SuburbanCustPortal.Models.SecurityQuestionModel @{ ViewBag.Title = Forgot Password

  • 0

I have the following web pages:

SecurityQuestion.cshtml

@model SuburbanCustPortal.Models.SecurityQuestionModel

@{
  ViewBag.Title = "Forgot Password Step 2";
}

<h2>Forgot Password Step 2</h2>
<p>
    Please provide the answer to your security question that you gave when you created your web account.
</p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    <div>
        <fieldset>
            <legend>Security Question and Answer</legend>

            <!-- this is the question -->
            <div class="editor-label">
                @Html.LabelFor(m => m.SecurityQuestion)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.SecurityQuestion, new { @class = "GenericTextBox", @readonly = "readonly" })
            </div>

            <!-- this is the answer -->
          <div class="editor-label">
                @Html.LabelFor(m => m.SecurityAnswer)
            </div>
          <div class="editor-field focus" >

            @Html.TextBoxFor(m => m.SecurityAnswer, new { @class = "GenericTextBox" })
            @Html.ValidationMessageFor(m => m.SecurityAnswer)
          </div>
                @Html.ValidationSummary(true, "The supplied answer did not match the answer on the account.")
          <p>
            <input type="submit" value="Complete Step 2" />
          </p>
        </fieldset>
    </div>
}

ForgotPassword.cshtml

    @model SuburbanCustPortal.Models.ForgotAccountInfoModel

    @{
      ViewBag.Title = "Forgot Password Step 1";
    }

    <h2>Forgot Password Step 1</h2>
    <p>
        Please provide the username or email address on your web account.
    </p>

    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

    @using (Html.BeginForm()) {
        <div>
            <fieldset>
                <legend>Email address</legend>

                <div class="editor-label">
                    @Html.LabelFor(m => m.UsernameOrEmail)
                </div>
                <div class="editor-field focus">
                    @Html.TextBoxFor(m => m.UsernameOrEmail, new { @class = "GenericTextBox" })
                    @Html.ValidationMessageFor(m => m.UsernameOrEmail)
                </div>
                    @Html.ValidationSummary(true, "Username or Email address was not found.")
              <p>
                <input type="submit" value="Complete Step 1" />
              </p>
              <br/>
              <p align="right">
                Step 1 of 3
              </p>
            </fieldset>
        </div>
    }

And this is in my controller:

public ActionResult SecurityQuestion()
{
  return View();
}

[HttpPost]
public ActionResult SecurityQuestion(SecurityQuestionModel model)
{
  const int maxnumberofattemptsallowed = 3;

  if (model.SecurityAnswerAttempts > (maxnumberofattemptsallowed -1))
  {
    var msg = 
        string.Format(
        "Max number of attempts allowed. Your account has been locked.{0}Please contact us for assistance in unlocking your account.",
        "<br>");
    ModelState.AddModelError("SecurityAnswer", msg);
    return View("LogOn");
  }

  if (_client.ValidateSecurityAnswer(model.AccountId, model.SecurityAnswer))
  {
    var msg =
      string.Format(
        "The supplied answer did not match the answer on the account.{0}You have {1} more attempt(s) before your account is locked.",
        "<br>", maxnumberofattemptsallowed - model.SecurityAnswerAttempts);
    model.SecurityAnswerAttempts++;
    ModelState.AddModelError("SecurityAnswer", msg);        
    return View(model);
  }

  // send email here

  return View(model);
}

public ActionResult ForgotPassword()
{
  return View();
}

[HttpPost]
public ActionResult ForgotPassword(ForgotAccountInfoModel model)
{
  var tokenid = MiscClasses.TokenIdCookie.GetTokenIdCookie();

  var secdata = new SecurityData();
  secdata.EmailOrUsername = model.UsernameOrEmail;
  secdata.TokenId = tokenid;
  secdata = _client.ForgotPasswordGetSecurityQuestion(secdata);
  if (!string.IsNullOrEmpty(secdata.SecurityQuestion))
  {
    var newmodel = new SecurityQuestionModel();
    newmodel.SecurityQuestion = secdata.SecurityQuestion;
    newmodel.SecurityAnswer = string.Empty;
    newmodel.SecurityAnswerAttempts = 0;
    newmodel.AccountId = secdata.AccountId;
    return View("SecurityQuestion", newmodel);
  }
  {
    ModelState.AddModelError("EmailAddressNotFound", "Email address not found.");
    return View(model);
  }
}

It should act in the following way:

ActionResult ForgotPassword() -> ForgotPassword View -> [HttpPost] ActionResult ForgotPassword(ForgotAccountInfoModel model) -> ActionResult SecurityQuestion() -> SecurityQuestion View -> [HttpPost] ActionResult SecurityQuestion(SecurityQuestionModel model)

Instead it is doing this:

ActionResult ForgotPassword() -> ForgotPassword View -> [HttpPost] ActionResult ForgotPassword(ForgotAccountInfoModel model) -> ActionResult SecurityQuestion() -> SecurityQuestion View -> [HttpPost] ActionResult ForgotPassword(ForgotAccountInfoModel model)

And for the life of me I cannot figure out why it is reloading the ForgotPassword POST!!!!

Anyone see what I am missing??

  • 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-06-14T10:17:35+00:00Added an answer on June 14, 2026 at 10:17 am

    Well, I have no idea why it is doing that, but I did a work around:

    CREATE view does not Post the create method from the controller

    I forced it to call the right method by doing this:

    @using (Html.BeginForm("SecurityQuestion", "Account", FormMethod.Post))
    

    Maybe this will help someone else

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

Sidebar

Related Questions

I have the following structure in a Java Web Application: TheProject -- [Web Pages]
I have the following code on my web pages: <div class=rep_tb0 id=Activity style=display:none;> <div
I have the following 404 error ActionResult which is thrown when web pages are
I have following web.xml. my jsf tags are rendered fine outsite folder /Pages but
The rails books and web pages I've been following have all stuck to very
I have the following Web page: link to page . If you go to
I have the following piece of code in my web page. After the method
I have the following textbox server control in my web page: <asp:TextBox ID=txtZip runat=server
I have the following HTML on my web page: <input id=htmlEdit type=checkbox/> Once the
I have the following links at the top of my web page: <ul class=icyLink>

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.