0
votes

There are Two kind of template in asp.net 3.5

1) Dynamic Data Web App.

2) Dynamic Data Web App. Entities

My SQL database has got Customer Table ; Columns : ID, Name,Surname vs.

if you use first one(Dynamic Data Web App); you can not see ID column(Customer Table) (Linq to Sql)

But if you use second one(Dynamic Data Web App. Entities), you can see ID column

How can i filter column especially ID area. I mean; i need ID column visible =false

1

1 Answers

0
votes

In your metadata class, set the Id to the following:

[ScaffoldColumn(false)]
public object Id { get; set; }

In case you don't have a reference to the metadata class, you add this by adding the attribute to the partial class, something like this:

[MetadataType(typeof(MyEntityFromTable_MD))]
public partial class MyEntityFromTable
{

}

Then you need the metadata class itself. Something like:

public class MyEntityFromTable_MD
{
        [ScaffoldColumn(false)]
        public object Id;
}