简体   繁体   中英

Asp.net simple membership. change password failing

I am using simple membership in my application. I have changed datatype of userId from int to bigint and accordingly changed datatype in all referenced field of userId. Create user, edit user functionality are working fine. but when we do change password, getting following error.

"implicit convert long to int? not possible"

My code:

if (ModelState.IsValid)
{
     bool resetResponse = WebSecurity.ResetPassword(model.ReturnToken.ToString(), model.Password.ToString());
     if (resetResponse)
     {
         ViewBag.Message = "Successfully Changed";
     }
     else
     {
         ViewBag.Message = "Something went horribly wrong!";
     }
}

Please let me know what is the problem.

thanks in advance.

try this:

enable-migrations
add-migration UserIdTypeChange ' or whatever you want to name it'     
update database

in

Package manager console

which can be found in

Tools-> Library package manager ->

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