26.06.2017 Views

Bootstrap for ASP.NET MVC

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2<br />

The code that achieves the preceding result (and can be viewed in the accompanying<br />

sample project) is as follows:<br />

@model Northwind.Web.Models.EmployeeViewModel[]<br />

<br />

<br />

About Us.<br />

Northwind Traders are a premier supplier of various food<br />

products,<br />

<br />

<br />

Our Team<br />

@<strong>for</strong>each (var item in Model)<br />

{<br />

<br />

<br />

<br />

@item.FirstName @item.LastName @item.<br />

Title<br />

<br />

@item.Notes<br />

<br />

}<br />

<br />

<br />

In this code, we looped through each employee item in the model and rendered an<br />

element using the EmployeeID property as the ilename. Each element's<br />

class attribute is set to img-circle, which will draw the image as a circle.<br />

[ 51 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!