I am new to asp.net and have been working through the tutorial - up to lesson 10, however I cannot get the partial view to work.
Controller:- ' ' GET: /ShoppingCart/CartSummary
<ChildActionOnly()>
Public Function CartSummary() As ActionResult
Dim cart = ShoppingCart.GetCart(Me.HttpContext)
ViewData("CartCount") = cart.GetCount()
Return PartialView("CartSummary")
End Function
Views:- CartSummary:-
@modeltype TEST.Cart
@Html.ActionLink("Cart (" & ViewData("CartCount") & ")", _
"Index", _
"ShoppingCart", _
New With {.id = "cart.GetCount"})
_Layout:-
<!DOCTYPE html>
<html>
<head>
<title>@ViewData("Title")</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
</head>
<body>
<div id="header">
<h1> ASP.NET MVC MUSIC STORE</h1>
<ul id="navlist">
<li class="first"><a href="@Url.Content("~")" id="current">Home</a></li>
<li><a href="@Url.Content("~/Store/")">Store</a></li>
<li>@Html.RenderAction("CartSummary", "ShoppingCart")</li>
<li><a href="@url.Content("~/StoreManager/")">Admin</a></li>
</ul>
</div>
<div id="main">
@RenderBody()
</div>
</body>
</html>
The error returned is "Expression does not produce a value". I can remove the tag and then display the CartSummary.
Thanks for any help.