How can I pass the input type text value to TempData
<input type='text' name='APP_COMMENT' />
@{TempData["APP"] = //This's where I want the input value;}
EDIT:
This's the action that I need to send from the View to Controller (Not Controller to view)
public ActionResult Approved()
{
Entities1 db = new Entities1();
string y=(TempData["APP"]).ToString(); //TempData is send from the View to Controller
decimal sl = (decimal)TempData["rt"];
var sp = db.TB_RST_SVCHDR.Where(x => x.REQ_NO == sl);
foreach (var p in sp)
{
if (p.STATUS == "N")
{
p.STATUS = "A1";
p.APP1_COMMENT = y; //Here's where the TempData is saved
p.APP1_DATEACTION = DateTime.Now;
p.APPROVER1 = "";
var s = p.APPROVER2;
//var ss = p.APPROVER2;
var s2 = p.REQUESTOR_EMPNAME;
TempData["email-act2"] = s2;
//SendEmail(s, ss);
SendEmail(s);
db.SaveChanges();
return View("~/Views/Home/Index.cshtml");
}
}
//return View();
return View("~/Views/Home/Index.cshtml");
}