我有个问题
在编辑模式下,我带来了用户数据,所有数据都正常出现
然后我将该数据添加到页面上的文本字段中,并且效果也很好
我敢肯定,正如我在调试模式下看到的那样
但是当页面进入浏览器时,密码字段为空,尽管我将数据放在上面
谁能告诉我问题出在哪里???
那是代码
方法从数据库中获取数据
public AdminsContianer getContainer(int adminId)
{
using (Naqqab context = new Naqqab())
{
IQueryable<user> admin = getContainer_compiledQuery2.Invoke(context, adminId);
if (admin.Count() > 0)
{
var add = admin.FirstOrDefault();
if (add != null)
{
var rc = new AdminsContianer();
rc.FirstName = add.user_firstname;
rc.adminCreationdate = (DateTime)add.user_creationdate;
rc.LastName = add.user_lastname;
rc.Username = add.user_username;
rc.Password = add.user_password;
rc.adminLuState = add.user_lu_status.ToString();
rc.adminLuType = add.user_lu_type.ToString();
rc.adminLevel = add.admin_level.ToString();
rc.adminId = add.user_id;
return rc;
}
else
{
return null;
}
}
else
{
return null;
}
}
}
方法将数据放入文本字段
public void FillFormFields(AdminsContianer ad)
{
HiddenAdminID.Value = AdminIdToEdit;
registerAdminUsername.Text = ad.Username;
registerAdminLastname.Text = ad.LastName;
registerAdminFirstname.Text = ad.FirstName;
registerAdminPassword.Text = ad.Password;
registerAdminCPassword.Text = ad.Password;
adminLevelDropDownList.SelectedValue = ad.adminLevel.ToString();
//userTypeDropDownList.SelectedValue = ad.adminLuType.ToString();
registerAdminState.SelectedValue = ad.adminLuState.ToString();
}
提前致谢