Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MVC4 question, displaying data in a grid...

Options
2»

Comments

  • Closed Accounts Posts: 1,143 ✭✭✭LordNorbury


    NoelOC wrote: »
    There a few ways you could do it.

    The fastest and easiest way I would suggest is to add a variable in your ViewModel for the page.
    You could also use a ViewBag instead depending on your ViewModel but it's the same concept.

    Wrap your Fieldset in an @if statement

    @if (ViewBag.Show == true )
    {
    <fieldset.......>
    }

    In your controller set ViewBag.Show = false on the page load and set it to true when your returning the page with data.

    Hope that makes sense.

    This worked a treat, it's hard to get used to working without event handlers and being able to switch visibility on and off I think...


Advertisement