您好,我正在尝试自定义错误消息的十进制,但看起来不起作用
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Market.Models;
namespace Market.ViewModels
{
public class QuettaCatViewModel
[Required(ErrorMessage = "Please fill Amount ")] //Work fine
public int Qentity { get; set; }
[Required(ErrorMessage = "What ever MSg go here")]//Not Fine Getting the default Msg
//[RegularExpression(@"^\d+.\d{0,2}$", ErrorMessage = "What ever MSg go here")]
public decimal Bedget { get; set; }
答案 0 :(得分:0)
我的床需要@ {await Html.RenderPartialAsync(“ _ ValidationScriptsPartial”);}