2
Answers

How to use Tempdata on refresh page also?

Photo of parth gupta

parth gupta

8y
5.2k
1
// Took result from one ActionMethod and kept it in TempData
 
// THIS IS Controller
 
int result = objDB.InsertEmployementApplication(OM);
TempData.Keep("result");
//Action Method which gets Value is Index
 
public ActionResult Index()
{
Response.Write("result is" + TempData.Keep("result") + " Thankssss");
return View("Index");
}
 
// THE ERROR IS (Error 1 Operator '+' cannot be applied to operands of type 'string' and 'void' )
 

Answers (2)