C#.Net 中的清除密码文本框
在更新模式下,我检索了输入的密码,如下所示:
txtConfirmPassword.Attributes["value"] = DR["Password"].ToString();
但在添加模式下,我想清除此文本框“txtConfirmPassword”。我已经给出如下:
txtConfirmPassword.Text = "";
但它还没有清除。如何清除这个文本框?
In the Update Mode, I have retrieved the Entered Password like below:
txtConfirmPassword.Attributes["value"] = DR["Password"].ToString();
But in the Add Mode, I want to clear this TextBox "txtConfirmPassword". I have given like below:
txtConfirmPassword.Text = "";
But it is not clearing. How to clear this TextBox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以用同样的方法清除该值。
原因:当您设置
TextMode="Password"
时,您将无法设置.Text
属性。在您的情况下,您尝试设置 txtConfirmPassword.Text = "";,它不会对文本框产生任何影响。You can clear the value in the same way.
Reason: When you set the
TextMode="Password"
, You will not be able to set the.Text
property. In your case you are trying to settxtConfirmPassword.Text = "";
, It will not have an any effect on Textbox.txtConfirmPassword.Clear();
那不是工作吗?
txtConfirmPassword.Clear();
Isnt that working?
一切都一定很难与此 asp.net 尝试启动/禁用自动完成,尝试更改文本,尝试更改值属性,尝试格式化我的电脑。 。 。只有这样它的作品:
Everything must be so hard with this asp.net try'd to set off/disabled for autocomplete , try'd to change text,try'd to change value attribute ,try'd to format my PC. . . only like this its works :