We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to iterate tile and its template for a group tile in MVC?

You can render group tile with template values from model by iterating the items. Refer to the following steps.

Initially, create a model file with necessary values used for rendering the tile with template feature. Following code example demonstrates the same.

template.cs

Then, pass the model from controller to view in a corresponding view action.

TileViewController.cs

Iterate templates from the model by using the following code example.

index.cshtml

Once the template element is rendered, you can create a group tile by iterating the items in Model. Then, create parent element with class group to make a group tile. After then, inside a loop, wrap your tile with div that contains class column for every third iteration. In this scenario, 3*3 group tile is used.

index.cshtml

Output

Article ID: Published Date: Last Revised Date: Platform: Control:
4960 05/23/2015 05/23/2015 ASP.NET MVC Tile
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.