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

  • SEARCH
  • Home
  • 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 7791987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:03:45+00:00 2026-06-01T22:03:45+00:00

I have an enum view model property which I want to hide in the

  • 0

I have an enum view model property which I want to hide in the CREATE View but show in the LIST/Index View. The enum is Open,Failed,Succeeded.

  • For the CREATE View the editor/control should not be visible.
  • For the LIST View the editor/control should be a selectable combobox

Can this be done somehow with the HiddenInput attribute?

If this can not be done then I want at least to make it visible in both views, but disabled/another control (label instead of combobox).

I am using asp.net mvc 4.0

  • 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-06-01T22:03:46+00:00Added an answer on June 1, 2026 at 10:03 pm

    Actually you should be using different view models. Remember: the first word of view model is view meaning that you define a view model per view. So you will have a CreateViewModel that will be used for the Create view without the enum property in question and a ListViewModel with the enum property that will be used in the Index view.

    When doing code reviews I see many developers trying to reuse the same models over different views and ending up with some horrible logic because those models simply are not adapted for those views. They try to hide, they try to write ifs and stuff to perform validation, usually end up in a maintenance nightmare.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an enum for one of the properties of my view-model. I want
I have a model view architecture. I want to create a view object from
I have a simple .Net enum. I also have a view model object which
i have enum public enum TypeImage { Img=0, Thumb=1 } i want in view
I have a view where I use a dropdown list with enum: public enum
I have a problem with enum description. I want that the dataGrid show me
I have the following view model to query my table: QuestionViewModel.cs public enum TypeQuestion
I have a model with an enum property (in this case, related to Export
I have a domain model and a view model as follows: Domain Model: namespace
I Have an Enum Called ActionStatus that has 2 possible values open=0 and closed

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.