These are my changes :
Script is sku:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="sku.ascx.cs" Inherits="Controls_ProductSummary_sku" %>
<%# GetSku((string)Product.Sku) %>
Code in sku.ascx.cs:
public partial class Controls_ProductSummary_sku : ProductSummaryUserControl {
private const int maxLengthToDisplay = 10;
protected void Page_Load(object sender, EventArgs e) {
}
protected string GetSku(string productSku)
{
if (string.IsNullOrEmpty(productSku))
return string.Empty;
if (productSku.Length <= maxLengthToDisplay)
return productSku;
return productSku.Substring(0, maxLengthToDisplay) + " ...";
}
}
and the eror message :
Compiler Error Message: CS1061: 'DotShoppingCart.Commercial.Core.Product' does not contain a definition for 'Sku' and no extension method 'Sku' accepting a first argument of type 'DotShoppingCart.Commercial.Core.Product' could be found (are you missing a using directive or an assembly reference?)
|