tempdata Questions

5

Solved

I've been trying to pass data to an action after a redirect by using TempData like so: if (!ModelState.IsValid) { TempData["ErrorMessages"] = ModelState; return RedirectToAction("Product", "Prod...
Guinevere asked 6/1, 2016 at 17:14

4

Solved

I have a method in my basecontroller class that adds data to tempdata to display pop-up messages. protected void AddPopupMessage(SeverityLevels severityLevel, string title, string message) { var ...
Auberon asked 10/6, 2019 at 14:38

2

In my index I added a search field. When user enter a search term and click filter the index (Index) is filtered. So far so good. What I would like to achieve is that if the user performs othe...
Wendywendye asked 7/6, 2017 at 15:55

4

Solved

Hello i am trying to add an object to TempData and redirect to another controller-action. I get error message 500 when using TempData. public IActionResult Attach(long Id) { Story searchedStory=t...
Titfer asked 23/1, 2018 at 19:22

5

Solved

I would like to have a very lightweight ASP.NET MVC site which includes removing as many of the usual HttpModules as possible and disabling session state. However when I try to do this, I get the f...
Catfish asked 19/5, 2009 at 20:28

1

Solved

In Controller, I save a collection of errors into cookies via TempData var messages = new List<Message>(); ... TempData.Put("Errors", messages); TempData.Put is an extension method public...
Cana asked 29/1, 2020 at 15:38

5

Solved

What is the difference between keep() and peek()? MSDN says: keep(): marks the specified key in the dictionary for retention. peek(): returns an object that contains the element that is associat...
Heavyweight asked 21/1, 2014 at 8:33

4

Solved

I am using TempData["hdn"] = "1"; in controller If I use this @{ var hdn = (string)TempData["hdn"]; } in View, TempData["hdn"] value in getting null in POST. If I skip this code in view...
Douville asked 28/8, 2013 at 11:53

4

I would like to use TempData in my .net core mvc application. I followed the article from https://learn.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-2.1#tempdata I always...
Tameratamerlane asked 23/7, 2018 at 16:5

3

Solved

I fill my TempData from a FormCollection and then I try to check the value of my TempData in my view with MVC 4 but my if statement isn't working as I expect. Here is my code. Controller : [HttpP...
Bryson asked 25/7, 2013 at 12:1

3

Solved

I am try to build alerts list and added them to TempData. But it work if I did not do redirect. When I do redirect it give me 500 error. I set break point in view as well but it did not hit when di...
Crystacrystal asked 1/1, 2017 at 4:39

7

Solved

I am trying to get the hang of MVC framework so bear with me. Right now, the only thing I'm using the session store for is storing the current logged in user. My website is simple. For this examp...
Tod asked 30/9, 2009 at 20:14

0

Thanks in advance. Please excuse me for my grammer. I tried my best to explain my issue In my quest of solving below question I started to develop a POC first. C# MVC No submit pass object betwee...
Ferris asked 19/4, 2016 at 21:12

3

Solved

Can somebody please explain the purpose of TempData in MVC. I understand it behaves like ViewBag but what does it do beyond that.
Illuminating asked 7/5, 2012 at 18:16

4

Solved

I'm working on an ASP.NET MVC 3 web application, where i use TempData to store a model object, in the scenario where the user is not logged in. Here's the flow: Use submits form. Code (special a...
Condensate asked 3/10, 2011 at 2:57

1

I have a controller action something similar to the below, TempData was initialized by my framework. I've noticed that TempData doesn't clear out the value once it is read as shown in the action "E...
Aero asked 14/9, 2015 at 18:31

3

Solved

I am using ASP.NET MVC 3 to build a web application. What I am trying to do is pass values between two controllers, though there are many ways to do this I am particular interested in using TempDa...
Chiclayo asked 14/9, 2012 at 10:44

8

Solved

I'm using the AcceptVerbs method detailed in Scott Gu's Preview 5 blog post for dealing with form entries in ASP.NET MVC: User gets an empty form via GET User posts the filled in form via POST to...
Joby asked 22/12, 2008 at 16:30

2

Solved

I am trying to access TempData in Javascript. but getting null value. I am making ajax call to Update the record and i want to display Record updated succesfully message. which will come from Updat...
Golf asked 25/3, 2013 at 5:19

3

Solved

I am trying to use a custom ITempDataProvider provider to store TempData in a browser's cookie instead of session state. However, everything works fine except that I am unable to remove the cookie ...
Chronicle asked 28/9, 2010 at 2:59

2

Solved

I have a custom action filter, that inside the OnActionExecuting, depending on certain criteria, logs out a user and redirects them to the home page of the site. The (stripped back) code for the re...
Jaenicke asked 22/4, 2013 at 11:10

4

Solved

Is there a way to let TempData store in a browser's cookie instead of Session State. I have Session State disabled on my site. Thanks.
Bradley asked 26/9, 2010 at 23:35

2

Solved

Where does TempData get stored in the ASP.NET MVC Framework (more specifically, ASP.NET MVC 2)? Is it stored at server-side, or is sent to the client?
Aphasic asked 21/2, 2013 at 13:57

6

Solved

If I redirect to a new page passing TempData to initialise the page it works fine, however if the user presses the refresh button in their browser the TempData is no-longer available. Given this, i...
Meatiness asked 15/4, 2010 at 1:2

1

Solved

I'm putting a value into TempData on first request in an actionfilter. filterContext.Controller.TempData["value"] = true; after that a second request comes in and I check for the value filterCo...
Sausa asked 10/10, 2012 at 9:7

© 2022 - 2024 — McMap. All rights reserved.