C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
3
Reply
What is syntax for Tempdata in MVC ?
Sandeep Kumar
9y
882
1
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
******* Set Temp Data *********** public ActionResult Index() {var model = new Test(){Name = "ABC",Salary=5000};TempData["ModelName"] = model;return RedirectToAction("About"); }******* Get Temp Data *********** public ActionResult About() { var model= TempData["ModelName"]; return View(model); }
Ritesh Singh
9y
0
Hi,******* Set Temp Data public ActionResult Index() {var model = new Test(){Name = "ABC",Salary=5000};TempData["ModelName"] = model;return RedirectToAction("About"); }******* Get Temp Data public ActionResult About() { var model= TempData["ModelName"]; return View(model); }Note: Please accept the answer if it help you and answer your question.Thanks & Regards, Ritesh
Ritesh Singh
9y
0
The syntax for Tempdata in MVC is Tempdata["variable "]=value;
Sandeep Kumar
9y
0
What is syntax for Viewbag in mvc ?
Mvc stands for what ?
Message