In the view strongly typed view against @model System.Tuple<Person, List<Survey>>
I use inside a for-each loop:
@Html.EditorFor(x => survey.Questions)
to render questions in a `Survey. It works flawless.
Now I would also like to pass additional data to the custom Editor Template. I did:
@Html.EditorFor(x => survey.Questions, new { htmlAttributes = new { PersonId = 1000 } })
and then in the Edtior Template I want to refer to this PersonId
and display it.
This is Editor Template I made(shortcut for question purposes):
@using WebApplication2.Models
@model Question
<div>
@ViewData["PersonId"]
</div>
but nothing shows up.
How to properly pass PersonId = 1000
to this EditorTemplate.