2014-02-08 40 views
0

當我嘗試加載註冊或登錄任何網頁,我得到這個錯誤:錯誤試圖加載登錄/註冊頁面時

堆棧跟蹤:

[MissingMemberException: Public member 'IsEmpty' on type 'String' not found.] 
    Microsoft.VisualBasic.CompilerServices.Container.GetMembers(String& MemberName, Boolean ReportErrors) +248 
    Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +61 
    Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +163 
    ASP._Page_Account_Register_vbhtml.Execute() +1940 
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +199 
    System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69 
    System.Web.WebPages.WebPage.ExecutePageHierarchy() +131 
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78 
    System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContext context) +226 

我用的IsEmpty幾次在我的代碼中。我不確定問題是什麼,因爲代碼在我的系統上運行良好,但是當我上載它並嘗試運行該網站時,會引發此錯誤。

任何幫助將不勝感激。

回答

0

看起來IsEmpty是一個擴展方法,你必須添加對where定義的引用。

<system.web> 
    <httpRuntime targetFramework="4.5" /> 
    <compilation debug="true" targetFramework="4.5" /> 
    <pages> 
     <namespaces> 
      <add namespace="System.Web" /> 
      ..... 
      <add namespace="YourWeb.Where.ExtensionsAre" /> 
     </namespaces> 
    </pages> 
</system.web> 

這那張圖的Web.config

+0

謝謝你,工作就像一個魅力。 – James