I have created a custom class inside App_Code and it worked fine.
However I needed to use localization which requires the customers current currency setting. However how can I get ThisCustomer inside my class without requiring it in the xslt call.
Here is a snippet of the code
C#/VB.NET Code:
public virtual string PriceRange(string sProductID)
{
string pricef = Localization.CurrencyStringForDisplayWithExchangeRate(price, ThisCustomer.CurrencySetting);
return pricef;
}
For argument sake lets say this code works fine. Now the problem is I want ThisCustomer in my class without having to change the xslt call to PriceRange(string sProductID, customer ThisCustomer)
At the start of the class I have
C#/VB.NET Code:
public Customer ThisCustomer
{
get
{
return m_ThisCustomer;
}
set
{
m_ThisCustomer = value;
}
}
But it is not working.
How can I get the current customer?
Thanks in advance.
Edit:
The error is; Object reference not set to an instance of an object.