2014-02-18 49 views
1

我有這樣的錯誤,顯示了(其實有2,但關於這部分代碼)ClientMembership沒有實現抽象成員

  1. 「MyApplication.Authorization.ClientMembership」不實現繼承的抽象成員'System.Web.Security.MembershipProvider.FindUsersByName'(string,int,int,out int)''不適用':System.Web.Security.MembershipProvider.FindUsersByName(string,int,int,outint)''不適用找到的方法覆蓋。

,而且我用的代碼是這一個:

public class ClientMembership : ExtendedMembershipProvider 
{ 
    public override bool ValidateUser(string username, string password) 
    { 
     MyApplication.Models.User usr = new MyApplication.Models.User(); 
     return usr.ValidareCredential(username, password); 
    } 
    public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords) 
    { 
     throw new NotImplementedException(); 
    } 
    public override MembershipUserCollection FindUserByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords) 
    { 
     throw new NotImplementedException(); 
    } 

我不知道該怎麼辦。有人可以幫幫我嗎?

+0

請仔細閱讀第二個錯誤。 – SLaks

+0

我現在編輯。請看一下。 – Phreak

回答

0

由於錯誤是想告訴你,你需要實現FindUsersByName()
您的FindUserByName()缺少s

+0

不錯!我這樣做,現在我得到這個錯誤 第1行:<%@ Application Codebehind =「Global.asax.cs」Inherits =「MyApplication.MvcApplication」Language =「C#」%> – Phreak

+0

這不是一個錯誤。 – SLaks

+0

我的意思是,當我運行該項目時,這是我在瀏覽器中獲得的。我在這個網站上看到了一些關於這個的東西,但它並沒有幫助我,因爲Gloabl.asax.cs是可以的,標記也是如此。 – Phreak

相關問題