Articles : Page 1 of 1

  • MVC 3 AdditionalMetadata Attribute with ViewBag to Render Dynamic UI

    MVC 3 AdditionalMetadata Attribute with ViewBag to Render Dynamic UI

    Jan 11
    31

    A few months ago I blogged about using Model metadata to render a dynamic UI in MVC 2. The scenario in the post was that we might have a view model where the questions are conditionally displayed and therefore a dynamic UI is needed. To recap the previous post, the solution was to use a custom attribute called [QuestionId] in conjunction with an “ApplicableQuestions” collection to identify whether each question should be displayed. This allowed me to have a view model that looked like this: ...


  • MVC 2 Model Metadata to Render Dynamic UI

    MVC 2 Model Metadata to Render Dynamic UI

    Sep 10
    09

    Recently we had a project where we needed to render certain questions on the screen dynamically based on answers to previous questions on previous screens.  For questions that need to dynamically be visible/invisible on the same screen, this can simply be controlled with jQuery.  However, in this case, based on the user’s input on previous screens we know there are certain questions that will not be applicable before the current screen even loads. In this case, we could use jQuery to set those...



  • 1