Exercise 1: UI Rendering Metadata in ASP.NET MVC 2In this Exercise, you will learn how to add Metadata Attributes to your model entities, and then take advantage of them to help rendering entity instances in an MVC View. These attributes are used to construct the Model Metadata objects that will be used in the views. The following attributes can be added to your entity to describe how it should be rendered:
Throughout this lab you will decorate your model entities with attributes to render the Activities in the Create view. Later on, you will extract this data from the view to create a Templated Helper for the Activity Class. Task 0 – Exploring the SolutionIn this task, you will explore the assets provided with this Lab in order to get a basic idea of what has to be done to implement the functionality it shows using MVC 1.0
Task 1 – Modifying Markup to Make Use New LabelFor and DisplayFor Methods
Task 2 – Adding Metadata for UI RenderingOne of the classes introduced in MVC 2 is ModelMetadata. This class in intended to provide convenient information about your model entities with the objective of enhancing the displaying and edition of them. In this task you will create a new metadata class for including attributes for rendering the activity entity.
Exercise 1: Verification
|