---
title: "Passing Information Between Controllers in ASP.Net-MVC"  
description: "Passing Information Between Controllers in ASP.Net-MVC"  
author: "Anonymous User"  
published: 2015-05-21  
updated: 2015-05-21  
canonical: https://www.mindstick.com/forum/23249/passing-information-between-controllers-in-asp-dot-net-mvc  
category: "asp.net mvc"  
tags: ["mvc4", "controller"]  
reading_time: 1 minute  

---

# Passing Information Between Controllers in ASP.Net-MVC

I have a login page login.aspx, which has [username](https://www.mindstick.com/forum/12798/there-is-no-viewdata-item-of-type-ienumerable-selectlistitem-that-has-the-key-username) and [password](https://www.mindstick.com/blog/118/retriving-user-password-by-using-stored-procedure-in-asp-dot-net) [fields](https://www.mindstick.com/forum/159126/sql-query-for-all-tables-and-fields-in-an-oracle-db), [as well as](https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application) an important little checkbox. Login is handled in the [account](https://www.mindstick.com/articles/33699/how-tech-is-disrupting-the-accounting-world) [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc) login action.

## Syntax:

```
[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](https://www.mindstick.com/forum/2005/radio-button-redirect)(returnUrl); fires, then it will [end up](https://www.mindstick.com/forum/156243/how-can-i-make-sure-my-emails-don-t-end-up-in-the-spam-folder) in another controller, the OpenIDController, and it is that situation where the sendStoredInfo bool becomes important. But the [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is I have no [reference](https://www.mindstick.com/forum/774/reference-what-does-this-error-mean-in-php) to it when I'm in the OpenIDController. How can I send this value across?

## Replies

### Reply by Anonymous User

Change the call to:

```
return RedirectToAction("LoginFailed", new { sendFlag =
sendStoredInfo });The controller action method signature could be something
like:public ActionResult LoginFailed(bool sendFlag){    ...}
```


---

Original Source: https://www.mindstick.com/forum/23249/passing-information-between-controllers-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
