Within the Create View for the "Deal" model, I have implemented a JavaScript function that is intended to generate a new object within a List Property when a specific button is clicked.
The error message "expression does not produce a value" has appeared. I am confused by this as I do not require a value; my objective is simply to create an empty object within the list.
Specifically, the line in the JavaScript of my view which adds the new Period to the list is triggering the error:
<script type="text/javascript">
function addRow() {
@Model.Periods.Add(New DealPeriod());
...
}
</script>
Details of the "Deal" Model:
Public MustInherit Class Deal
...
<Display(name:="Periodos")>
Public Property Periods As New List(Of DealPeriod)