密码格式被刷新的问题解决
在开发程序的过程中,如果页面刷新,如果文本框(this.TextBox1.Text)为密码格式的话,很容易就被刷新掉数据,以下为解决方案
private void Page_Load(object sender, System.EventArgs e)
{
if(Page.IsPostBack)
{
if (this.TextBox1.Text != "")
{
this.TextBox1.Attributes.Add("value", this.TextBox1.Text);
}
}
}