Scott Hanslman's demo (Nothwnd) works fine under visual studio , but when hosted as an application under IIS 7 I had problems with image urls.
<%
@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="ListingByCategory.aspx.cs" Inherits="MyStore.Views.Products.ProductListingByCategory" Title="Untitled Page" %>
<
asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server"><% foreach (var product in ViewData) { %>
<%
if (product.Category.CategoryName != null) { %> <h2> <%=product.Category.CategoryName %></h2>
<%
break; %><%} //end if %><%}//end foreach %>
<ul class="productlist">
<% foreach (var product in ViewData) { %>
<li>
============================= I tried placing a tilde in front of /Content/Images/... but it was just passed through to the html source. How do form these urls to find the root folder?
<img src="/Content/Images/<%=product.ProductID%>.jpg" alt="<%=product.ProductName %>" />
<br/>
<a href="/Products/Detail/<%=product.ProductID %>"> <%=product.ProductName %> </a>
<br />Price: <%=String.Format("{0:C2}", product.UnitPrice)%>
<span class="editlink"">(<%=Html.ActionLink("Edit", "Edit", new { ID=product.ProductID })%>)
</span>
</li>
<% } %>
</ul>
</
asp:Content>