//因为密码TextBox 比较特殊,try;
//按下那个<按钮1>后 , 重新对TextBox赋值;密码框id:TextBoxPasswordstring password;
void Page_Load(object sender,System.EventArgs e)
{
password=this.TextBoxPassword.Text;
//other code
}
void Button1_Click(object sender,System.EventArgs e){
this.TextBoxPassword.Text = password;
//other code
}
//按下那个<按钮1>后 , 重新对TextBox赋值;密码框id:TextBoxPasswordstring password;
void Page_Load(object sender,System.EventArgs e)
{
password=this.TextBoxPassword.Text;
//other code
}
void Button1_Click(object sender,System.EventArgs e){
this.TextBoxPassword.Text = password;
//other code
}
所以你前面输入的就没有了
你这样用吧,按钮1的代码:
Session["Pwd"] = this.txtPwd.Text();再用的时候,把它取出来
Session["Pwd"].ToString()
{
public class myclass
{
private static string mystr;
public string Mystr
{
get
{
return mystr;
}
set
{
mystr = value;
}
}
//你的函数
}
}//你的页面类文件
void Page_Load(object sender,System.EventArgs e)
{
myclass myObj = new myclass();
myObj.Mystr = this.TextBoxPassword.Text;
//other code
}
void Button1_Click(object sender,System.EventArgs e){
this.TextBoxPassword.Text = myObj.Mystr;
//other code
}