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.
If you want to use the Html.RenderAction helper here's the correct syntax:
@Code
    @Html.RenderAction("CartSummary", "ShoppingCart")
End Code
Or if you prefer a one-liner:
@Code @Html.RenderAction("CartSummary", "ShoppingCart") End Code
or if you want to use the the Html.Action helper this is the syntax:
@Html.Action("CartSummary", "ShoppingCart")
Contrast those two with their C# equivalents:
@{Html.RenderAction("CartSummary", "ShoppingCart");}
@Html.Action("CartSummary", "ShoppingCart")
As a VB.NET guy you might find the following article useful.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论