I am using Asp.net MVC 4 and .NET 4.5. I have a single column table that is a decimal, not a null value. I created a razor view using the MVC forest pattern for the model created by the Entity framework for this table.
Now, when we enter 0 or nothing (null) in the text field of the decimal property, on the server it comes as 0. and after checking it is displayed as zero in the text field.
Is there any way by which we can determine if the client is entered in the zero or zero value in the text field, so that after sending the message back, if there is any check, the client receives the value that he published
Update 1
public partial class Student
{
public int StudentID { get; set; }
public string LastName { get; set; }
public string FirstMidName { get; set; }
public System.DateTime EnrollmentDate { get; set; }
public decimal RollNo { get; set; }
}
- class generated by EF.
@Html.TextBox("Students[0].RollNo", Model.Students[0].RollNo)
, .