如何在ASP.NET中使用textmode = password保存文本框中的密码 [英] How do I save password from a textbox with textmode = password in ASP.NET
本文介绍了如何在ASP.NET中使用textmode = password保存文本框中的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从我设置了TextMode =密码的文本框中保存用户密码
单击提交按钮后返回null。请帮帮我。
谢谢
Please I want to save user password from a textbox that I have set its TextMode = "Password"
It returns null after submit button is clicked. Please help me out.
Thanks
推荐答案
最佳猜测?你没有检查你的页面加载事件处理程序,看看它是否是一个回发,并清除密码字段。
因为你得到一个页面加载每个用户点击按钮的时间,它发生在按钮点击事件之前,该字段将始终为空白。
尝试:
Best guess? You don't check in your Page Load event handler to see if it's a post back or not, and clear the password field.
Since you get a page load every time the user clicks a button, and it occurs before the button click event the field will always be blank.
Try:
private void Page_Load()
{
if (!IsPostBack)
{
// fill in your page info
...
}
}
这篇关于如何在ASP.NET中使用textmode = password保存文本框中的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文