//因为密码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.   

    因为你按了按钮以后,页面重新刷新了
    所以你前面输入的就没有了
    你这样用吧,按钮1的代码:
    Session["Pwd"] = this.txtPwd.Text();再用的时候,把它取出来
    Session["Pwd"].ToString()
      

  2.   

    using System;namespace mynamespace
    {
        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 
    }