如何在回发中保存密码文本? [英] How to save password text on postback?

查看:98
本文介绍了如何在回发中保存密码文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有问题..希望anyvody可以尝试为我解决问题...
我正在使用VS2010 .... i正在尝试创建注册页面.
我有以下控件可以注册

1)电子邮件ID(文本框)
2)密码(文本框)
3)重新输入密码(文本框)
4)安全问题下拉列表(autopostback = true)

在此DDlist中,每当我选择设置您自己的问题"时,都会出现一个新的文本框.
但是,当页面回发时,在密码文本中写入的密码会消失.....

我尝试了什么:
1)试图将密码文本保存在会话中...不高兴..

请帮助处于危险之中的工作... thx

i have a problem here..hope anyvody can try to sol it for me...
i am using VS2010 ....i am trying to create a registration page.
I have following controls to register

1) email id(textbox)
2) password(textbox)
3) re-enter password(textbox)
4) security question drop-down list(autopostback =true)

In this DDlist, when ever i choose ''set your own question'', a new textbox appears.
However when the page posts back, the password written in the password text gets disappeared.....

What did i tried :
1) tried to save the password text in session...no joy..

please help..job in danger...thx

推荐答案

无论做什么,都不要在任何地方保存密码!这是不安全的.通过回发,未加密的密码将通过网络.这已经足够危险了.

(我希望您也理解密码不应存储在任何地方.身份验证不需要密码本身,因为您始终可以将其加密的散列形式进行比较,然后将其存储在服务器上.)

—SA
Whatever you do, never save password anywhere! This is unsafe. Through a postback, the unencrypted password goes through network. This is dangerous enough.

(I hope you also understand the password should not be stored anywhere. You don''t need a password itself for authentication as you can always compare its encrypted a hashed form which can be stored on the server.)

—SA


我认为您可以使autopostback = false;
试试这个:

this.EditButton.Attributes ["onClick"] =返回false;";

这可能对您有所帮助
I think you can make autopostback=false;
try this:

this.EditButton.Attributes["onClick"] = "return false;";

this may help u


默认情况下,密码控件无法在回发之间保存其值
使用以下方法.

只需将txtPassword.Attributes.Add("Value",txtPassword.Text)行添加到触发回发的按钮单击事件即可,现在可以使用了.

-happy编程
By default the password control can''t save its value between postbacks
use the following way.

Just add the line txtPassword.Attributes.Add("Value", txtPassword.Text) to the button click event that trigger the postback and now is working.

-happy programming


这篇关于如何在回发中保存密码文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆