我在Web表单上有几个按钮,当用户点击它们时,它们将更新文本框.这一直工作,直到我添加了textmode = password.现在文本框不再显示文本.我调试了该应用程序,并且text属性正在获取该值,但是再一次显示.
这是我试过的:
protected void btn_punch_7_Click(object sender,EventArgs e) { const string string_punch_Number_7 = "7"; var text = txt_punch.Text; text += string_punch_Number_7; txt_punch.Text = text; } protected void btn_punch_8_Click(object sender,EventArgs e) { const string string_punch_Number_8 = "8"; var text = txt_punch.Text; text += string_punch_Number_8; txt_punch.Text = text; }
我也累了这个:
public partial class WebForm3 : System.Web.UI.Page { public string string_punch; protected void Page_Load(object sender,EventArgs e) { MultiView1.SetActiveView(View1); txt_punch.Width = 300; txt_punch.Height = 50; txt_punch.MaxLength = 4; txt_punch.Attributes.Add("OnChange",string_punch); } protected void btn_punch_7_Click(object sender,EventArgs e) { const string string_punch_Number_7 = "7"; string_punch = txt_punch.Text; string_punch += string_punch_Number_7; txt_punch.Text = string_punch; } protected void btn_punch_8_Click(object sender,EventArgs e) { const string string_punch_Number_8 = "8"; string_punch = txt_punch.Text; string_punch += string_punch_Number_8; txt_punch.Text = string_punch; }