I want to add dynamicly new partial form on page. I used this code:
Guid index = Guid.NewGuid();
<input type="hidden" name="People.index" value="@index" />
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.surname, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBoxFor(model => model.surname, new { name = "Author[index].surname", htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.surname, "", new { @class = "text-danger" })
</div>
</div>
But in source code after page loading i see this:
<div class="form-group">
<label class="control-label col-md-2" for="surname">Фамилия</label>
<div class="col-md-10">
<input htmlAttributes="{ class = form-control }" id="surname" name="surname" type="text" value="" />
<span class="field-validation-valid text-danger" data-valmsg-for="surname" data-valmsg-replace="true"></span>
</div>
</div>
How i can enabled Guid in name field? And how change fields in TextBoxFor?