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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:28:33+00:00 2026-05-13T17:28:33+00:00

This is a duplicate of How to RedirectToAction in ASP.NET MVC without losing request

  • 0

This is a duplicate of How to RedirectToAction in ASP.NET MVC without losing request data


Hi, I have come into a problem which is making me scratch my head a little bit. Basically I have a login page Login.aspx , which has username and password fields, as well as an important little checkbox. The login is handled in the AccountController Login method. The code currently is as follows:

[AcceptVerbs(HttpVerbs.Post)]
[SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
    Justification = 
        "Needs to take same parameter type as Controller.Redirect()")]
public ActionResult LogOn(string userName, string password, string returnUrl, 
    bool sendStoredInfo)
{
    if (!this.ValidateLogOn(userName, password)) {
        return View();
    }

    this.FormsAuth.SignIn(userName, false);

    if (!String.IsNullOrEmpty(returnUrl)) {
        return Redirect(returnUrl);
    } else {
        return RedirectToAction("Index", "Home");
    }
}

Basically, if the line return Redirect(returnUrl); fires, then it will end up in another controller, the OpenIDController, and it is that situation where the sendStoredInfo bool becomes important. But the problem is I have no reference to it when I’m in the OpenIDController. How can I send this value across?

  • 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-13T17:28:34+00:00Added an answer on May 13, 2026 at 5:28 pm

    Change the call to:

    return RedirectToAction("LoginFailed", new { sendFlag = sendStoredInfo });
    

    The controller action method signature could be something like:

    public ActionResult LoginFailed(bool sendFlag)
    {
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In ASP.NET MVC you can return a redirect ActionResult quite easily: return RedirectToAction("Index"); or
My application is in Asp.Net MVC3 coded in C#.Net. I have Views which contains
This is duplicate of Can XmlSerializer deserialize into a Nullable<int>? but I need a
I have my company's website (Visual Studio / vb / asp.net 4.0) localized in
I'm trying to learn a bit of ASP.net MVC 3 and I'm facing a
I am able to find out the duplicate data using this query SELECT names
Possible Duplicate: This R reshaping should be simple, but dcast from reshape2 works without
Sorry if this is duplicate,I would think it would be but couldn't find anything.
How do you duplicate this feature in Java? In C#, you could use the
I'm trying to duplicate this, http://jqueryui.com/demos/autocomplete/#remote-jsonp . Only, instead of querying the geonames.org server

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.