ok, now i'm getting the following error:
Code:
XmlPackage Exception: Exception=Last Trace Point=[]. Extension object 'urn:aspdnsf' does not contain a matching 'SizeColorQtyOptionVertical' method that has 7 parameter(s).
System.ArgumentException: Last Trace Point=[]. Extension object 'urn:aspdnsf' does not contain a matching 'SizeColorQtyOptionVertical' method that has 7 parameter(s).
at AspDotNetStorefrontCommon.XmlPackage2.TransformString() at AspDotNetStorefrontCommon.AppLogic.RunXmlPackage(XmlPackage2 p, Parser UseParser, Customer ThisCustomer, Int32 SkinID, Boolean ReplaceTokens, Boolean WriteExceptionMessage)
Here is the full code for myfunctions.cs:
Code:
// ------------------------------------------------------------------------------------------
// Copyright AspDotNetStorefront.com, 1995-2007. All Rights Reserved.
// http://www.aspdotnetstorefront.com
// For details on this license please visit the product homepage at the URL above.
// THE ABOVE NOTICE MUST REMAIN INTACT.
// ------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;
using System.Resources;
using System.Globalization;
using System.Reflection;
using System.Data;
using System.Configuration;
using System.Drawing;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Threading;
using System.Text;
using System.Text.RegularExpressions;
using AspDotNetStorefrontCommon;
/// <summary>
/// Summary description for MyCode
/// </summary>
///
namespace mynamespace
{
public class InputValidator
{
private String m_RoutineName = String.Empty;
public InputValidator(String RoutineName)
{
m_RoutineName = RoutineName;
}
private void ReportError(String ParamName, String ParamValue)
{
throw new Exception("Error Calling XSLTExtension Function " + m_RoutineName + ": Invalid value specified for " + ParamName + " (" + CommonLogic.IIF(ParamValue == null, "null", ParamValue) + ")");
}
public String ValidateString(String ParamName, String ParamValue)
{
if (ParamValue == null)
{
ReportError(ParamName, ParamValue);
}
return ParamValue;
;
}
public int ValidateInt(String ParamName, String ParamValue)
{
if (ParamValue == null ||
!CommonLogic.IsInteger(ParamValue))
{
ReportError(ParamName, ParamValue);
}
return Int32.Parse(ParamValue);
;
}
public Decimal ValidateDecimal(String ParamName, String ParamValue)
{
if (ParamValue == null ||
!CommonLogic.IsNumber(ParamValue))
{
ReportError(ParamName, ParamValue);
}
return Localization.ParseDBDecimal(ParamValue);
;
}
public Double ValidateDouble(String ParamName, String ParamValue)
{
if (ParamValue == null ||
!CommonLogic.IsNumber(ParamValue))
{
ReportError(ParamName, ParamValue);
}
return Localization.ParseDBDouble(ParamValue);
;
}
public bool ValidateBool(String ParamName, String ParamValue)
{
if (ParamValue == null)
{
ReportError(ParamName, ParamValue);
}
ParamValue = ParamValue.ToUpperInvariant();
if (ParamValue == "TRUE" || ParamValue == "YES" ||
ParamValue == "1")
{
return true;
}
return false;
}
public DateTime ValidateDateTime(String ParamName, String ParamValue)
{
DateTime dt = DateTime.MinValue;
if (ParamValue == null)
{
ReportError(ParamName, ParamValue);
}
try
{
dt = Localization.ParseDBDateTime(ParamValue);
;
}
catch
{
ReportError(ParamName, ParamValue);
}
return dt;
}
}
public class keough
{
protected Customer m_ThisCustomer;
//Public Methods
public Customer ThisCustomer
{
get { return m_ThisCustomer; }
}
public virtual string SizeColorQtyOptionVertical(String sProductID, String sVariantID, string sColors, string sSizes)
{
return SizeColorQtyOptionVertical(sProductID, sVariantID, sColors, sSizes, "Color", "Size");
}
public virtual string SizeColorQtyOptionVertical(String sProductID, String sVariantID, string sColors, string sSizes, string sColorPrompt, string sSizePrompt)
{
return SizeColorQtyOptionVertical(sProductID, sVariantID, sColors, sSizes, "Color", "Size", "");
}
public virtual string SizeColorQtyOptionVertical(String sProductID, String sVariantID, string sColors, string sSizes, string sColorPrompt, string sSizePrompt, string sRestrictedQuantities)
{
InputValidator IV = new InputValidator("SizeColorQtyOptionVertical");
int ProductID = IV.ValidateInt("ProductID", sProductID);
int VariantID = IV.ValidateInt("VariantID", sVariantID);
String RestrictedQuantities = IV.ValidateString("RestrictedQuantities", sRestrictedQuantities);
String Colors = IV.ValidateString("Colors", sColors);
String Sizes = IV.ValidateString("Sizes", sSizes);
StringBuilder results = new StringBuilder("");
String[] ColorsSplit = Colors.Split(',');
String[] SizesSplit = Sizes.Split(',');
sColorPrompt = CommonLogic.IIF(sColorPrompt.Length > 0, sColorPrompt, "Color");
sSizePrompt = CommonLogic.IIF(sSizePrompt.Length > 0, sSizePrompt, "Size");
String Prompt = sColorPrompt + "/" + sSizePrompt;
if (Sizes.Length == 0 && Colors.Length == 0)
{
Prompt = AppLogic.GetString("common.cs.78", ThisCustomer.SkinID, ThisCustomer.LocaleSetting);
results.Append(Prompt);
String FldName = ProductID.ToString() + "_" + VariantID.ToString() + "_" + 0.ToString() + "_" + 0.ToString();
if (RestrictedQuantities.Trim().Length == 0)
{
results.Append("<input name=\"Qty_" + FldName + "\" type=\"text\" size=\"3\" maxlength=\"3\">");
}
else
{
results.Append("<small>" + Prompt + "</small>");
results.Append("<select name=\"Qty_" + FldName + "\" id=\"Qty_" + FldName + "\" onChange=\"if(typeof(getShipping) == 'function'){getShipping()};\" size=\"1\">");
results.Append("<option value=\"\">" + AppLogic.GetString("admin.common.ddSelect", ThisCustomer.SkinID, ThisCustomer.LocaleSetting) + "</option>");
foreach (String s in RestrictedQuantities.Split(','))
{
if (s.Trim().Length != 0)
{
int Q = Localization.ParseUSInt(s.Trim());
results.Append("<option value=\"" + Q.ToString() + "\">" + Q.ToString() + "</option>");
}
}
results.Append("</select> ");
}
}
else
{
results.Append("<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" style=\"border-style: solid; border-color: #EEEEEE; border-width: 1px;\">\n");
results.Append("<tr>\n");
results.Append("<td valign=\"middle\" align=\"left\"><b>" + Prompt + "</b></td>\n");
for (int i = SizesSplit.GetLowerBound(0); i <= SizesSplit.GetUpperBound(0); i++)
{
results.Append("<td valign=\"middle\" align=\"center\">" + SizesSplit[i].Trim() + "</td>\n");
}
results.Append("</tr>\n");
for (int i = ColorsSplit.GetLowerBound(0); i <= ColorsSplit.GetUpperBound(0); i++)
{
results.Append("<tr>\n");
results.Append("<td valign=\"middle\" align=\"right\" >" + ColorsSplit[i].Trim() + "</td>\n");
for (int j = SizesSplit.GetLowerBound(0); j <= SizesSplit.GetUpperBound(0); j++)
{
results.Append("<td valign=\"middle\" align=\"center\">");
String FldName = ProductID.ToString() + "_" + VariantID.ToString() + "_" + i.ToString() + "_" + j.ToString();
results.Append("<input name=\"Qty_" + FldName + "\" type=\"text\" size=\"3\" maxlength=\"3\">");
results.Append("</td>\n");
}
results.Append("</tr>\n");
}
results.Append("</table>\n");
}
return results.ToString();
}
}
}
and here is my xmlpackage:
Code:
<xsl:value-of select="aspdnsf:SizeColorQtyOptionVertical(ProductID, VariantID, '', Sizes, 'Sizes', ' ', RestrictedQuantities)" disable-output-escaping="yes" />
all i'm trying to do is copy the 'SizeColorQtyOption' function from XSLTExtensionbase.cs and tweak it slightly.