如何更改表的显示名称在ASP.Net动态数据 [英] How to change the DisplayName of a table in ASP.Net Dynamic Data

查看:220
本文介绍了如何更改表的显示名称在ASP.Net动态数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的动态数据。我想改变表的显示名称中Default.aspx页面,所以我可以设置意为他们的全名。此外,我想改变表的列名时,我名单,编辑和插入模式。我该怎么做,在C#语言?

I'm new to Dynamic Data. I want to change the DisplayName of tables in Default.aspx page so I can set meaning full names for them. Also I want to change column names of tables when I List, Edit and Insert mode. How can I do that in c# language?

推荐答案

您可以通过设置显示名称(从 System.ComponentModel <做到这一点对每个表/ code>)属性。为此,您需要一个局部类,你与动态数据例如脚手架每个表。

You can do this by setting the DisplayName (from System.ComponentModel) attribute on each table. For this you'll need a partial class for each table that you're scaffolding with Dynamic Data e.g.

using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

...

[ScaffoldTable(true)]
[DisplayName("Northwind Products")]
partial class Product
{
}

渲染...

这篇关于如何更改表的显示名称在ASP.Net动态数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆