Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
是否可以在索引视图中使用 LabelFor 作为标题行
我正在尝试在 ASP NET MVC 索引视图中利用 DataAnnotation 值 有趣的是 代码生成器使用字段名称 例如 BlogPost 而不是Html LabelFor m gt Model ColumNames BlogPost
ASPNETMVC
dataannotations
POST 和 PUT 的不同模型要求
假设我有一个控制器CatController包括 GET POST 和 PUT 操作 他们都使用相同的Cat资源可能如下所示 public class CatDto public int Id get set Required public
c
aspnetwebapi
dataannotations
ASP.Net MVC 3 - 客户端对编辑器模板进行不显眼的验证
我是 ASP Net MVC 3 的新手 在尝试对我创建的用于以自定义方式显示日期的编辑器模板实现客户端非侵入式验证时遇到一些问题 UI我需要在 a 中显示日期三个文本框 UI格式为 我已经放了一个编辑器模板用于将日期显示为三部分 mode
aspnetmvc3
dataannotations
editortemplates
unobtrusivevalidation
显示名称属性与显示属性
有什么区别DisplayName属性和DisplayASP NET MVC 中的属性 DisplayName设置DisplayName在模型元数据中 例如 DisplayName foo public string MyProperty g
c
ASPNETMVC
dataannotations
displayattribute
netattributes
如何验证 Blazor EditForm 中的单个字段?
我得到了EditContext from CascadingParameter CascadingParameter public EditContext EditContext get set 我意识到存在一个 Validate方法 验证
c
Blazor
dataannotations
blazorserverside
blazorclientside
ASP.NET MVC4 多语言数据注释
在标准应用程序中 我有以下内容 Required DisplayName Email Address public string EmailAddress get set 这反过来会自动为该表单字段生成英文标签 现在 如果我需要我的应用程序
c
NET
ASPNETMVC
dataannotations
multilingual
DataAnnotations 的 FileExtensions 属性在 MVC 中不起作用
我正在尝试使用 MVC 中的 HTML FileUpload 控件上传文件 我想验证文件只接受特定的扩展名 我尝试过使用 DataAnnotations 命名空间的 FileExtensions 属性 但它不起作用 请参阅下面的代码 pub
c
NET
ASPNETMVC
FileUpload
dataannotations
如何使用 System.ComponentModel.DataAnnotations.AssociationAttribute
前段时间我问过这样一个问题 每个 System ComponentModel DataAnnotations 属性的用途是什么 然而 我没能得到回复 这个问题有点宽泛 因为它要求提供有关每个数据注释属性的文档 此时此刻 我最感兴趣的是Ass
aspnetmvc3
entityframework4
poco
dataannotations
实体框架代码第一个唯一列
我正在使用 Entity Framework 4 3 并使用 Code Fist 我有课 public class User public int UserId get set public string UserName get set
EntityFramework
dataannotations
entityframework43
自定义验证属性指定的方法未被调用
我正在使用 System ComponentModel DataAnnotations CustomValidationAttribute 来验证我的 POCO 类之一 当我尝试对其进行单元测试时 它甚至没有调用验证方法 public cl
c
validation
dataannotations
自定义验证属性存在多个实例问题
我在 C 4 中使用命名空间 System ComponentModel DataAnnotations 来实现我自己的验证属性 它看起来像这样 AttributeUsage AttributeTargets Class AllowMult
c
aspnetmvc2
attributes
dataannotations
FluentValidation
如何在正则表达式中忽略大小写?
我有一个 ASP NET MVC 应用程序 有一个名为 File 的实体 它有一个名为 Name 的属性 using System ComponentModel DataAnnotations public class File Regul
ASPNETMVC
regex
dataannotations
自定义验证属性 MVC2
我有一个自定义验证属性 用于检查两个属性是否具有相同的值 例如密码和重新输入密码 AttributeUsage AttributeTargets Property AttributeTargets Field AllowMultiple f
c
aspnet
aspnetmvc2
dataannotations
ASP.NET MVC 自定义多字段验证
我正在开发一个 ASP NET MVC 5 2 3 自定义数据注释 用于在 Visual Studio 2015 中进行验证 它需要采用任意数量的字段 并确保如果一个字段有值 则它们都必须有值 如果它们都是空 空白 那就应该没问题 一些例子
c
aspnet
ASPNETMVC
validation
dataannotations
如何手动调用验证属性? (数据注释和模型状态)
我们的某些逻辑需要迭代模型的属性以自动绑定属性 并希望扩展功能以包含 C 4 0 中的新数据注释 目前 我基本上迭代所有 ValidationAttribute 实例中加载的每个属性 并尝试使用 Validate IsValid 函数进行验
aspnet
dataannotations
aspnetmvc3
modelstate
validationattribute
«
1
2
3
4
5
6
7
8