本文介绍了隐藏ASP.NET动态数据的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法将属性适用于ASP.NET动态数据模型文件隐藏的列?
Is there any way to apply an attribute to a model file in ASP.NET Dynamic Data to hide the column?
例如,我可以当前设置这样的列的显示名称:
For instance, I can currently set the display name of a column like this:
[DisplayName("Last name")]
public object Last_name { get; set; }
有没有类似的方式来隐藏的列?
Is there a similar way to hide a column?
修改:非常感谢基督教Hagelid为要加倍努力,并给予一个点上的答案: - )
Edit: Many thanks to Christian Hagelid for going the extra mile and giving a spot-on answer :-)
推荐答案
不知道什么ASP.NET动态数据是如此,你promted我这么一些研究:)
Had no idea what ASP.NET Dynamic Data was so you promted me to so some research :)
看起来你正在寻找的属性。
Looks like the property you are looking for is
[ScaffoldColumn(false)]
还有一个类似的属性表
There is also a similar property for tables
[ScaffoldTable(false)]
source
这篇关于隐藏ASP.NET动态数据的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!