Node is saved as draft in My Content >> Draft
-
Temp Data in MVC
Temp Data is dictionary which is used to store data into the controller to access it into the view.
It stores data for a short period of time just like the session.
It is mainly used to store one time message.
//Controller Code
public ActionResult Index()
{
List<string> Student = new List<string>();
Student.Add("Jignesh");
Student.Add("Tejas");
Student.Add("Rakesh");
TempData["Student"] = Student;
return View();
}
//page code
<ul>
<% foreach (var student in TempData["Student"] as List<string>)
{ %>
<li><%: student%></li>
<% } %>
</ul>
Temp Data holds data between request and response.
With the help of Keep method we can store the value of temp data even after request completion.
0 Comment(s)