下面给出的代码是检查用户名n通过cookie显示密码。它完美无缺。因为我想要屏蔽password.text中显示的值,我将password.text的textmode更改为'password'。 因此,值不会传递到文本框。
我该如何解决这个问题?
String cookiename = TextBox1.Text;
//grab cookie
HttpCookie cookie = Request.Cookies[cookiename];
//exists?
if (null == cookie)
{
Label1.Text = "cookie not found";
}
else
{
password.Text=cookie.Value.ToString();
}
谢谢,
答案 0 :(得分:1)
TextBox2.Attributes.Add(“value”,cookie.Value.ToString());