简体   繁体   中英

How to override ValidateUser in Membership provider method

By default Membership provider has a static method ValidateUser with parameter .Is there a way to add an overloading method to Membership provider for ValidateUser with three parameter. There parameter is Boolean which will decided user is teacher or student in my case.

public static bool ValidateUser(string username, string password, bool blnTeacher);

I tried to add but Membership class is read-only in visual studio . How can i can add ValidateUser with three parameter.

ValidateUser is really just there to validate the password.

From the documentation :

Verifies that the supplied user name and password are valid.

Chances are, you are using the wrong tool for the job, and another tool exists for your need:

What are you actually trying to validate here? (ie what will happen depending on whether the user is a student or a teacher ?)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM