I am using Asp.net MVC 4 and .NET 4.5. I have a table with one column which is decimal not null value. I have created a razor view using scaffolding template of MVC for model that is created by Entity framework for that table.
Now when we enter 0 or nothing(null) on text box of decimal property, on server it is coming as 0. and after validation it displays as zero on text box.
is there any way using which we can identify whether client has entered zero or null on text box so that after post back, if any validation comes, client gets the value which he/she has posted
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; }
}
is the class that EF has generated.
and in View I have used
@Html.TextBox("Students[0].RollNo", Model.Students[0].RollNo)
in my model, this list of this class is a property.