Hi I have one view called Visitors Form. In that View i have one field called Employee.

In the above menion image i kept Employee field as dropdown. But now i dont want to keep that field as dropdown field. If i login and open this form means it have to load the login person name automatically in the employee field and also i enter all the data and click the save button means it have to save that id in table aslo.
My View
*
@Html.Label("Employee Name", new { @class = "control-label" })
@Session["LoginUserName"].ToString();
I Wrote code which is mention above But it is not working. . please any one help to resolve this issue.
Advance thanks.
Bhuvanesh MohankumarPosted May 9, 2016, 4:36 AM
Hi,
Make use of "TempData" to maintain data between multiple views.
//First request, get value marking it from deletion
object value = TempData["value"];
TempData.Keep("value");
object value = TempData["value"];