views:

105

answers:

2

i asked:

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

And You said:

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;
}

You are correct! But if i try to searcyh. i find this link:

http://mattberseth.com/blog/2008/08/dynamic_data_and_custom_metada.html

http://mattberseth.com/blog/2008/08/aspnet_dynamic_data_simple_5_t.html

i read. and i understand to make my request: i need App_code but i don't find it ! how can i find App_code

+1  A: 

If you do not have an App___Code folder you are probably working with a Web Application not a Web Site. You can add the partial class anywhere in the WebApplication (you do not need to add it within the App_Code folder). Although I may recommend creating a "Models" folder and putting it there (or create a separate project, and create it there - but that may be more complex than you're looking for).

Aaron Hoffman
+1  A: 

When using a Web Application Project you do not need a App_Code folder you can create classes anywhere in the project, you will need to make sure that your metadata classes are in the same namespce as the model that you want to annotate with metadata.

Wizzard