62,041
社区成员
发帖
与我相关
我的任务
分享
if(获取到的信息==密码为空) //说明只有密码一项错误,没别的错误
{
提交;
}
else
{
不提交;
}
if(model.passWord=="")
{
//提示密码不能为空
return;
}
这很难吗
2、接着你现在的状态来
你不是已经获取到错误信息了吗,去掉modelstate.isvalid判断,改为:
if(获取到的信息==密码为空) //说明只有密码一项错误,没别的错误
{
提交;
}
{
不提交;
}
context.Attach(entity2);
context.Entry(entity2).Property(m => m. 密码).IsModified = entity2.密码 != null;
context.SaveChanges();