?
Solved

Html.DisplayFor -- Hide per User Request, ASP.net MVC4

Posted on 2013-12-13
1
Medium Priority
?
759 Views
Last Modified: 2014-08-04
Does anyone have some ASP.net MVC4 "commandButton"
code that does something like the below step #2 ?

 1. page displays with all values below
 2. user decides they don't want to see the below
      "@Html.DisplayFor(modelItem => item.DR)"
     so they click a "HIDE/SHOW" button
 3. this field disappears, but all others remain visible
------------------------------------------------------------------------------------------------------------
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.IFSWO)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DR)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RefDRNo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProjectID)
0
Comment
Question by:finance_teacher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Jeroen Timmermans earned 2000 total points
ID: 40198778
I'll assume item.DR is a boolean, you can add
@{if(item.DR)}
@{end if}

Open in new window


Around the bits you want to hide.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question