腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(218)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
1
回答
无法获得
DisplayAttribute
名称
我希望使用分配给每个属性的相同的
DisplayAttribute
来为该属性提取显示的Name值,以达到另一目的。private static string GetDisplayName(Type dataType, string fieldName)
DisplayAttribute
attr;attr = (
DisplayAttribute
)dataType.GetProperty(fieldName).GetCustomAttributes(typeof(
DisplayAttribute
)= null)
浏览 1
修改于2017-05-23
得票数 3
回答已采纳
1
回答
JsonPropertyAttribute Cancels
DisplayAttribute
因为它们是两个函数的模型,所以我使用
DisplayAttribute
和JsonPropertyAttribute (Newtonsoft.Json)装饰我的模型类,以给出一个可读的标签以及一个完全不同的序列化属性名称是否有已知的
DisplayAttribute
和JsonPropertyAttribute之间的兼容性问题会导致这种情况?也许是一种没有明确记载的优先顺序?
浏览 5
修改于2015-08-18
得票数 0
回答已采纳
1
回答
DisplayAttribute
关闭验证消息
所以当我让
DisplayAttribute
在我的模型中装饰一处房产时.
浏览 3
提问于2011-04-25
得票数 0
1
回答
通过
DisplayAttribute
添加TypeBuilder
请帮助我为我尝试过的一个属性添加
DisplayAttribute
,但是将consturtor错误作为null var fieldName = string.Format("Prop
浏览 2
修改于2015-05-20
得票数 2
回答已采纳
2
回答
DisplayAttribute
内部的Html标记
我希望显示名称包含一些html文本。[Display(Name = "First Name <b class=\"red\">boldtext</b>)]但在浏览器的屏幕上我看到:而不是:我能做些什么让它使用Display属性吗? 基本上,我想显示红色*在所有必需的属性之后,或者如果这种方式不能工作,还有其他方法可以更好地做到
浏览 0
修改于2011-08-27
得票数 2
1
回答
C#覆盖
DisplayAttribute
与LabelFor
我目前的想法是要么修改LabelFor 而不需要在末尾添加额外的参数,要么修改DataAnnotations 中的
DisplayAttribute
而不使用重命名它,或者使用我的类名代替显示。当我尝试修改
DisplayAttribute
时,它只做我想做的事情,当我将它从Display更改为myDisplay时。我使用了不同的源,并且得到了不同的结果,所以我会在这里问:是否有任何方法可以修改/重写LabelFor或
DisplayAttribute
而不分别添加新的参数或重命名方法? 非常感谢您提前!
浏览 3
修改于2017-05-23
得票数 0
回答已采纳
1
回答
获取Parent属性的
DisplayAttribute
model => model.LastName)<label for="FirstName">Value</label> 是否可以通过查看parent属性的
DisplayAttribute
浏览 0
提问于2012-02-08
得票数 0
回答已采纳
1
回答
并将ToolTip绑定到
DisplayAttribute
在我的视图模型中,我已经将DisplayAttributes添加到我的属性中,并且现在希望将我的TextBox控件的ToolTip属性绑定到
DisplayAttribute
的Description属性。
浏览 2
修改于2017-05-23
得票数 4
回答已采纳
1
回答
DisplayAttribute
ResourceType找不到资源
我希望使用资源以不同的语言显示名称。在下面的代码中有错误:{ public string CurrentPassword { get; set; } public str
浏览 5
提问于2021-05-02
得票数 1
3
回答
在类上使用
DisplayAttribute
因为我们可以使用System.ComponentModel.DataAnnotations.
DisplayAttribute
为属性设置标签,所以我想对类使用它,但它不允许在类中使用。
浏览 0
修改于2012-07-03
得票数 8
1
回答
ASP.NET MVC
DisplayAttribute
和接口
public string Password { get; set; }}在此行显示来自
DisplayAttribute
的正确消息在该行上,它不显示来自
DisplayAttribute
的正确标签附言:我知道如何将
DisplayAttribute
添
浏览 0
提问于2010-04-16
得票数 0
回答已采纳
1
回答
从PropertyInfo获取
DisplayAttribute
属性
Select(p => new p.Name, p.GetCustomAttributes(typeof(
DisplayAttribute
浏览 0
修改于2011-09-07
得票数 18
回答已采纳
2
回答
DisplayAttribute
-如何设置默认资源?
(ModelResources), Name="Product.ProductName")]在这种情况下,我不能仅仅从
DisplayAttribute
浏览 1
修改于2013-06-20
得票数 3
回答已采纳
5
回答
ASP.NET核
DisplayAttribute
定位
我正在寻找一种在
DisplayAttribute
中本地化文本的方法。有什么建议来正确地做这件事吗?
浏览 12
修改于2016-09-12
得票数 17
回答已采纳
1
回答
使用
DisplayAttribute
的ASP.NET MVC本地化
我想使用
DisplayAttribute
本地化我的资源(表单标签、验证消息等)。我的资源在数据库中,但是看起来
DisplayAttribute
使用了resx文件,并且类本身是密封的,所以我不能派生一个子类并覆盖所需的方法/属性。有没有办法处理
DisplayAttribute
使用的资源管理器,从数据库而不是resx文件中获取资源。 不,我不能使用resx文件。
浏览 4
修改于2010-09-17
得票数 1
回答已采纳
1
回答
DisplayAttribute
不在模型中本地化其属性
我在WPF应用程序中使用了MVVM模式,并将带有本地化的
DisplayAttribute
应用于我的模型的属性:{ ResourceType我还按照
DisplayAttribute
的要求,将Build Action设置为Embedded Resource,并将Custom Tool设置为PublicResXFileCodeGenerator但是
DisplayAttribute
为其Name参数返回"MyPropertyName“,而不是本地化字符串。 我使用Di
浏览 2
修改于2013-06-03
得票数 1
回答已采纳
2
回答
DisplayAttribute
会鼓励不良实践吗?
我正在努力寻找用
DisplayAttribute
注释我的视图模型的真实价值。
浏览 2
提问于2011-04-11
得票数 2
回答已采纳
2
回答
为什么System.ComponentModel.DataAnnotations.
DisplayAttribute
是密封的?
我本来打算实现一个自定义的
DisplayAttribute
,以便允许基于模型值动态显示值,但由于
DisplayAttribute
是密封的,所以无法实现。在我开始编写自己的客户属性来模拟
DisplayAttribute
的行为之前,有人能想到为什么它是密封的吗?
浏览 0
提问于2012-02-23
得票数 4
回答已采纳
1
回答
Silverlight中不工作的
DisplayAttribute
名称属性
这门课看起来是这样的:public class PersonGeneralDetails // Properties [
DisplayAttribute
(Name = "Sira")] [
DisplayAttribute
(Name
浏览 1
修改于2015-02-01
得票数 6
回答已采纳
3
回答
DisplayAttribute
.GroupName属性用于什么?
我正在试图找出属性的有效用法。一个值,用于对UI中的字段进行分组。 不使用此属性获取GroupName属性值。使用GetDescription方法代替。空值或空字符串是有效的。 那么,这个属性是用来做什么的,我应该使用它(可能与自定义模板或自定义ModelMetadataProvider一起使用)来呈现域周围的群框?
浏览 5
提问于2011-07-11
得票数 5
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
第 9 页
第 10 页
第 11 页
点击加载更多
领券