Answered by:
Disable editing using dynamic data.

Question
-
User1204604062 posted
Hello \
There is a special table in which I wouldnt like the user to edit. Just delete or insert.
How can I disable editing using attributes?
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Sodexo.Data
{
[MetadataType(typeof(ContractAssetMetaData))]
[DisplayColumn("Contract", "Contract", false)]
public partial class ContractAsset
{
public string AssetName
{
get
{
return this.Asset.Placa + ' ' + this.Asset;
}
}
}
[DisplayName("Activos por Contrato")]
public class ContractAssetMetaData
{
[ScaffoldColumn(false)]
public object ContractId { get; set; }
[ScaffoldColumn(false)]
public object AssetId { get; set; }
[DisplayName("Activo")]
public object AssetName { get ; set; }
[DisplayName("Contrato")]
public object Contract{ get; set; }
}
}
Tuesday, January 6, 2009 2:38 PM
Answers
-
User-1005219520 posted
If it's just one table why don't you create a custom page and remove the edit link? See How To: Create a Read-Only Dynamic Data Web Site and follow the appropriate instructions.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, January 6, 2009 3:38 PM -
User1204604062 posted
Thats exactly what I tought, and already did.
Thx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, January 6, 2009 4:34 PM
All replies
-
User-1005219520 posted
If it's just one table why don't you create a custom page and remove the edit link? See How To: Create a Read-Only Dynamic Data Web Site and follow the appropriate instructions.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, January 6, 2009 3:38 PM -
User1204604062 posted
Thats exactly what I tought, and already did.
Thx
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, January 6, 2009 4:34 PM -
User-330204900 posted
Have alook at Dynamic Data - Hiding Tables on the Default.aspx page near the bottom are some of the advantages of doing it this way.
Tuesday, January 6, 2009 6:22 PM