|
So on the users page the user can use a drop down to select their name and then click 'view' to view the list of holidays they have previously booked. From here they can choose 'select new' which will allow the user to create a new holiday. This all works fine however I want the username to be stored from the original drop down and displayed in the creating page. Instead of having 2 seperate drop downs on each page.
I have tried:
My first drop down in my Index.chtml
@Html.DropDownListFor(model => model.HList4DD.First().HolidayDate, new SelectList(Model.PList4DD, "Id", "Name", Model.currentPersonID), "--select--")
My second drop Down on the create view:
@Html.DropDownListFor(model => model.PersonId, new SelectList(ViewBag.Id, "Value", "Text"),"---Select---")
-----------------------
I wanted to change this to the name of the user previously selected so in my get of the Index I have used:
TempData["CurrentPersonID"] =currentPersonID;
Then to replace my second drop down im trying something like:
@TempData["CurrentPersonID"]
<div>
@Html.LabelFor(model => model.currentPersonID, "currentPersonID")
@Html.ValidationMessageFor(model => model.PersonId)
</div>
Any suggestions? Thanks
|
|
|
|