Linked Questions

3 votes
4 answers
11k views

C# MVC pass data from one action method to another [duplicate]

I have tried to pass data from one Action to another in the same Controller.But always it is coming as null Action1 ViewData["page"] = pageData; Action2 var pageData = ViewData["page"];//Always ...
cbrebel's user avatar
  • 85
0 votes
0 answers
42 views

Passing data between controllers ASP.NET [duplicate]

So, I'm creating a basic time table application, and I want to pass the user name to another controller like that: //POST [HttpPost] [ValidateAntiForgeryToken] public IActionResult Index(Login obj) { ...
Charles Marguerite's user avatar
0 votes
0 answers
40 views

Passing data between two Method in Controller [duplicate]

public async Task<ActionResult> Index(tempUser userDetails) { temp.Name = userDetails.Name; temp.Pass= userDetails.Pass; db.tempUsers.Add(temp); ...
Alex's user avatar
  • 787
59 votes
8 answers
72k views

MVC - Passing Data with RedirectToAction()

I'd like to take data entered in an MVC user form and display it in a different view. The class has the following private variable: IList<string> _pagecontent = new List<string>(); The ...
splatto's user avatar
  • 3,209
6 votes
4 answers
41k views

Passing Information Between Controllers in ASP.Net-MVC

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 ...
Jacob Bellamy's user avatar
6 votes
1 answer
21k views

How to pass model data to one controller to another controller

pass model data to one controller to another controller is possible? I want to passe the model data to one controller ro another controller. [HttpPost] public ActionResult Personal(...
aruni's user avatar
  • 2,682
5 votes
2 answers
16k views

Passing a class object from one controller action to different controller action in ASP.net MVC 4

I want to pass a class object from one controller action to different controller's action. Sender Action public class CourseController : Controller { [HttpPost] public ActionResult CreateNewCourse(...
Rohit's user avatar
  • 6,535
3 votes
3 answers
11k views

Passing TempData between controllers

My question simply is, how could the TempData be passed between Different controller? Naturally, because the controller contexts are different one controller should not be able to access the tempdata ...
JAX's user avatar
  • 1,560
1 vote
1 answer
4k views

Passing data from one controller to another in asp.net mvc

I am new to ASP.NET MVC. I have RestCallcontroller class. I want to pass data from Restcontroller to Home Controller. This is theRestController public class RestCallController : Controller { ...
RMD's user avatar
  • 311
0 votes
2 answers
5k views

MVC passing complex object to action

I have two actions in my controller when a user call one i need to redirect it to another one and pass a complex object : first action : public virtual ActionResult Index(string Id) { ...
Anton Selin's user avatar
  • 3,552
4 votes
2 answers
2k views

How to pass single parameter in RedirectToAction to different controller in ASP .NET MVC?

I know, a similar question is asked before. But I couldn't find exact similar case. I want to pass model object in return RedirectToAction() to method in another controller. My code: MyModel mdl_obj=...
Jass's user avatar
  • 361
0 votes
1 answer
730 views

Action getting a null parameter C# MVC 4

When I debug through my code, I can see the results have data stored but when it reaches the Results action...results is null. Why is this happening? The default action gets the right parameter and ...
user3788671's user avatar
  • 2,017
-1 votes
3 answers
1k views

c# mvc retrieve data from a view

I want to retrieve data from a view, it should work like this: User fill a form available on the webpage User clicks SEARCH button Some function(s) collect the data and display them in another view ...
Lea's user avatar
  • 47
-1 votes
2 answers
653 views

How to pass a variable from a controller to other controller using MVC 4

I have a view that executes some conditions and if one specific condition is X it must redirect to another page and show a pop-up with a message, so I was thinking in a variable with the resul of the ...
Cristhiano's user avatar
2 votes
0 answers
955 views

How access one controller properties in another controller

How access one controller data in another controller. I'm using ASP.NET MVC 4. I am trying to access one controller properties in another controller. I'm not getting this. I'm not sure if this is ...
Balanjaneyulu K's user avatar

15 30 50 per page