문제

I am using ASP.NET Dynamic Data. The page dynamically creates a List, Edit, Details pages to display the records stored in the table in the DB.

I have the Sub Contractors in the table but I want its visibility set to false on screen. I've tried

[HideColumnIn(PageTemplate.List)]
[Display(Name = "SubContractor Id", Order = 70)]
public object SubContractorId { get; set; }

ALSO:

[ReadOnlyColumnIn(PageTemplate.List)]

But no joy. Iv made these changes in the database.cs file. Anyone know how can I make it disappear or remove the hyperlink from it?

EDIT:

[ScaffoldColumn(false)] usually works but because SubContractorId is a FK it seems to not take effect.

도움이 되었습니까?

해결책

Consider the possibility of using Custom pages (List and other) for your Dynamic Data site which allows you hide specific fields.

For more information: How to: Customize the Layout of an Individual Table By Using a Custom Page Template

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top