<li>
<%=Html.UITemplates().FieldLong().TextBox("OrderRequest.AdditionalParties[0].ContactDetails[0].Address.Line1", "Address", Model.OrderRequest.AdditionalParties[0].Address.Line1)%>
</li>
The above line when Address is null throws a null reference exception. I don't know how to handle it as I still want to display view while Address.Line1 should be displayed as empty string.
Html.UITemplates().FieldLong().TextBox()? Its not part of MVCModel.OrderRequest.AdditionalParties[0].Address == null ? string.Empty : Model.OrderRequest.AdditionalParties[0].Address.Line1 %>try this.Html.UITemplates().FieldLong().TextBox("OrderRequest.AdditionalParties[0].ContactDetails[0].Address.Line1")which will set the value attribute tovalue=""if its null, and no exception will be thrown