更改textmode无效,尽管它已转到服务器并进行调试 这是设计
<asp:TextBox ID="txtPassword" ClientIDMode="Static" runat="server" TextMode="Password"></asp:TextBox>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:CheckBox ID="CheckBox1" Text="Show Password" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" />
</ContentTemplate>
</asp:UpdatePanel>
这是代码
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
txtPassword.TextMode = TextBoxMode.SingleLine;
}
else
{
txtPassword.TextMode = TextBoxMode.Password;
}
}