1
0
mirror of https://github.com/rudollee/LearningMVC.git synced 2025-06-07 07:56:14 +00:00
LearningMVC/Razor/Views/Home/DemoExpression.cshtml
2017-04-03 23:33:58 +09:00

41 lines
916 B
Plaintext

@model Razor.Models.Product
@{
ViewBag.Title = "DemoExpression";
}
<table>
<thead>
<tr><th>Property</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td>Name</td><td>@Model.Name</td></tr>
<tr><td>Price</td><td>@Model.Price</td></tr>
<tr>
<td>Stock Level</td>
<td>
@switch ((int)ViewBag.ProductCount)
{
case 0:
@: Out of Stock
break;
case 1:
<b>Low Stock (@ViewBag.ProductCount)</b>
break;
case 2:
@ViewBag.ProductCount
break;
}
</td>
</tr>
</tbody>
</table>
<div data-discount="@ViewBag.ApplyDiscount" data-express="@ViewBag.ExpressShip" data-supplier="@ViewBag.Supplier">
The containing element has data attributes
</div>
Discount: <input type="checkbox" checked="@ViewBag.ApplyDiscount" />
Express: <input type="checkbox" checked="@ViewBag.ExpressShip" />
Supplier: <input type="checkbox" checked="@ViewBag.Supplier" />