Here is the code:
@(Html.Telerik().Menu()
.Name(
"Menu2")
.Items(menu =>
{
foreach (var category in ViewBag.categories)
{
menu.Add()
.Text(category.name)
.Content(@<text>
<ul class="product-list">
<li class="product">
<img src="@Url.Content("~/Content/PanelBar/Templates/exposure.gif")" alt="Understanding Exposure" />
<p>
Understanding Exposure:
<br /> How to Shoot Great Photographs
</p>
</li>
<li class="product">
<img src="@Url.Content("~/Content/PanelBar/Templates/digitalCamera.gif")" alt="The Ultimage Guide" />
<p>
Get the Most from Your
<br />Digital Camera: The Ultimage Guide
</p>
</li>
<li class="product">
<img src="@Url.Content("~/Content/PanelBar/Templates/slr.gif")" alt="Digital SLR Cameras" />
<p>
Digital SLR Cameras:
<br />Photography for Dummies
</p>
</li>
</ul>
</text>);
}
})
.Orientation(
MenuOrientation.Vertical)
)
When I run it I get the following error:
CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type