【发布时间】:2012-08-08 19:11:26
【问题描述】:
任何人都知道是否可以执行以下操作:
public class User
{
public Guid UserID { get; set; }
[Required(ErrorMessage="A school selection is required.")]
[Range(1, int.MaxValue, ErrorMessage="School not found. Please contact support at <a href='mailto:support@mysite.com'>support@mysite.com</a>")]
public int SchoolID { get; set; }
// ... other properties
}
没有@Html.ValidationMessageFor(model => model.SchoolID) 编码HTML?也许我需要为此制作一个自定义助手扩展?有没有更简单的方法?任何指导将不胜感激。如果辅助扩展是要走的路,我如何访问辅助扩展方法中的验证规则以确保 html 不会被编码?
谢谢。
【问题讨论】:
标签: c# asp.net-mvc-3 data-annotations