我有一个由扫描仪填充的文本框,它会插入额外的空格,换行符,制表符等。我需要在激活验证之前清理它们。我的代码:
[Integer(ErrorMessage = "Survey ID must be a number.")]
public long? SurveyRecipientID { get; set; }
@Html.ValidationMessageFor(m => m.SurveyRecipientID)
@Html.LabelFor(m => m.SurveyRecipientID, "Survey ID")
@Html.TextBoxFor(m => m.SurveyRecipientID)