2014-02-20 39 views
-1

我想寫一個新的XSLT包。我使用的代碼是CS1518:期望的類,委託,枚舉,接口或結構

public virtual string CustomShowInventoryTable(String sProductID, String sVariantID) 
{ 
     StringBuilder results = new StringBuilder(""); 
     if (AppLogic.AppConfigBool("ShowInventoryTable")) 
     { 
      results.Append(AppLogic.GetInventoryTable(ProductID, VariantID, true,  ThisCustomer.SkinID, true, false)); 
     } 
     return results.ToString(); 
} 

我得到的錯誤是

編譯器錯誤信息:

CS1518: Expected class, delegate, enum, interface, or struct 

我已經試過了文件,但我內檢查(和)仍然得到這個編譯錯誤。

+1

編譯器會告訴你哪一行,以及該行的列,它的抱怨。那是哪條線? (在這種情況下,在這之前發生了什麼,因爲這個消息通常意味着你的大括號不能正確匹配。) – keshlam

+0

它的這個行公共虛擬字符串CustomShowInventoryTable(String sProductID,String sVariantID) –

回答

2

我相信你有幾個錯字在你的代碼:

  • 應該public virtual String,不string。或者,也許string sProductID, string sVariantID而不是String,這取決於您使用的是哪種語言。

  • AppLogic.GetInventoryTable(ProductID, VariantID - 是否定義了那些變量?你的方法獲得的那些有不同的名稱,sProductIDsVariantID ...

相關問題