I guess this line is throwing error for your case in SearchList.cs-
public decimal ListPrice
{
get
{
if (_listPrice != null)
return ((SearchListUserControl)_listPrice).ListPrice;
***return decimal.Parse(string.Empty);***
}
}
change return decimal.Parse(string.Empty), it will never work, change it to return decimal.MinValue instead, and add some checking when you use the value
Though I dont get what you are trying to achieve with this method, but you can use TryParse to distinguish between pure string and number, may be like this -
public void SetProduct(string product)
{
decimal ListPrice;
if(decimal.TryParse(product, out ListPrice)
{
TextBox_ListPriceList.Text="ListPrice";
}
else
{
if (product == "ProductNumber")
{
TextBox_ProdNumList.Text = "ProductNumber";
}
else if (product == "Color")
{
TextBox_ColorList.Text = "Color";
}
else if (product == "Name")
{
TextBox_NameList.Text = "Name";
}
else if (product == "MoreInformation")
{
TextBox_MoreInfoList.Text = "MoreInformation";
}
}
}