Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. label for a hidden model property still displays in the View.

label for a hidden model property still displays in the View.

Scheduled Pinned Locked Moved ASP.NET
htmlcom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stephen Holdorf
    wrote on last edited by
    #1

    I have a View where I am try to hide both the bottom model's label value and the model's edit box from the View.  Now the Vew displays the hidden model property's label in the view even though in the model I am using the [HiddenInput(DisplayValue = false)] annotation. It is true that the [HiddenInput(DisplayValue = false)] does hide the edit box for the model's property in the View but the label still displays.  I read an article that indicated that the best way to do this was to use the [ScaffoldColumn(false)] annotation in the model instead but that allowed both the label and the edit box to display. The code is below. Does anyone know what I'm doing wrong. View: @using (Html.BeginSearchForm(Model)) { @Html.HiddenFor(x => x.ForRequest) Enter Search Criteria @RenderSelection("criteriaSecetion") } Model [HiddenInput(DisplayVlaue = false)] public string contractNumber { get; set; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups