Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:54:41+00:00 2026-05-23T21:54:41+00:00

Is there an attribute that I can use with ASP.NET MVC 3 to prevent

  • 0

Is there an attribute that I can use with ASP.NET MVC 3 to prevent model fields from automatically showing up in my view? What I mean by this is that I have classes like the following:

public class EntityBase
{
    public int ID { get; set; }
    //more fields...
}

public class TestEntity : EntityBase
{
    public string TestEntityName { get; set; }
    //more fields...
}

I know about all of the attributes in System.ComponentModel and System.ComponentModel.DataAnnotations to enforce validation – Required, StringLength, etc. – but is there one I can use that will prevent certain fields from showing up in the view when I create it from Visual Studio? All of my project’s model classes inherit from EntityBase, but I don’t want any of EntityBase‘s fields to be visible on the view. I’m using Razor as my ViewEngine, in case it matters.

TIA,

Benjy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:54:41+00:00Added an answer on May 23, 2026 at 9:54 pm

    Use ScaffoldColumn:

    [ScaffoldColumn(false)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In ASP.NET MVC, you can use the AcceptVerbs attribute to correlate a view function
Is there an attribute I can use on a method so that when stepping
Is there any way to apply an attribute to a model file in ASP.NET
Is there a simple attribute or data contract that I can assign to a
I have an ASP.NET MVC project with a form. In the Action method that
Is there anything that would aid us in designing/scaffolding View models from SQL Server
My ASP.NET MVC 3 website has code on the server side that checks for
Although I know that I can use &quote , I was wondering if there
After reading ASP.NET MVC 2 in Action and watching Jimmy Bogard's presentation from MvcConf
Is there a way to do the following? I see that the Attribute Arguments

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.