How to clear specific TempData in asp.net mvc. I am using more than two TempData
var. I can to clear specific some of them.
TempData["USD"] = "updated";
TempData["EUR"] = "updated";
TempData["PKR"] = "updated";
TempData.Clear()
will clear all TempData, how to do this for specific
just this worked for me fine, only removed TempData["USD"]
TempData.Remove("USD");
var value = filterContext.Controller.TempData["value"];
filterContext.Controller.TempData.Remove("value");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With