Node is saved as draft in My Content >> Draft
-
Persistent and Temp Data in MVC
TempData is used to pass data from one view to another view.
void Keep
When we call this method within the current action then it ensures that at the end of the current request the items in the TempData were not removed.
@model MyProject.Models.EmpModel;
@{
Layout = "demo.cshtml";
ViewBag.Title = "About";
var tempDataEmployeet = TempData["emp"] as Employee; //need typcasting
TempData.Keep(); // retains all strings values
}
void Keep(string key)
Calling this will keep the data into it
@model MyProject.Models.EmpModel;
@{
Layout = "~/Views/Shared/Layout.cshtml";
ViewBag.Title = "About";
var tempDataEmployeet = TempData["emp"] as Employee; //need typcasting
TempData.Keep("emp"); // retains only "emp" string values
}
0 Comment(s)