<div class="kuven"> <a href="~/ShoppingCart" id="cartCount" class="nav-link style="></a><asp:image id="Kuve" runat="server" width="40" height="40" alt=""></div>
protected void Page_PreRender(object sender, EventArgs e) { using (ShoppingCartActions usersShoppingCart = new ShoppingCartActions()) { Image Kuve = new Image(); Kuve.ImageUrl = "..WebBilleder/indkobskuve.png"; string cartStr = string.Format(Kuve + "({0})", usersShoppingCart.GetCount()); cartCount.InnerText = cartStr; } }
using (ShoppingCartActions usersShoppingCart = new ShoppingCartActions()) { // delete this // Image Kuve = new Image(); // change the path string to match your folder structure where ~ is the root of your site Kuve.ImageUrl = VirtualPathUtility.ToAbsolute("~/WebBilleder/indkobskuve.png"); // just set the InnerText direct cartCount.InnerText = usersShoppingCart.GetCount().ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)