我尝试使用按钮更改TextMode
字段。在此操作期间,文本被清除
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
string constring2 = passwordtxt.Text;
if (passwordtxt.TextMode == TextBoxMode.Password)
{
passwordtxt.TextMode = TextBoxMode.SingleLine;
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert(+constring)</script>");
}
else
{
passwordtxt.TextMode = TextBoxMode.Password;
ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Inserted succussfully')</script>");
}
passwordtxt.Text = constring2;
}