I am generating Form elements using a Model Class as below
Public Class BookAppointment
Property DoctorNin As Integer
Property PatientNin As Integer
Property BookingDate As Date
Property Doctors As IEnumerable(Of SelectListItem)
End Class
When I pass this View Model to the view page, some of the values are already there as default value but they are invalid.
Like for PatientNin
I use
<%= Html.TextBoxFor(Function(x) x.PatientNin)%>
When the form gets rendered, it get a 0
as a default value, which is unwanted. How to control such default values?
In the above case, same happens with BookingDate
and in the textbox I get 1/1/0001 12:00:00 AM
Which is out of format and unwanted default value?
How to solve problem like this?