This is a migrated thread and some comments may be shown as answers.

RadTextBox TextMode = Password not work properly

3 Answers 156 Views
Input
This is a migrated thread and some comments may be shown as answers.
Chamin
Top achievements
Rank 1
Chamin asked on 27 Jun 2012, 11:09 AM
I have created textbook dynamically as follows,

Dim control As New RadTextBox()
control.ID = "txtpassword"
control.Text = obj.FieldValue
control.CssClass = obj.CssClass
control.WrapperCssClass = obj.WrapperCssClass
control.AutoPostBack = obj.IsAutoPostBack
control.TextMode = obj.TextMode
for the password I have pass the value '2' for textmode.

Actually I have create the control on page load. But i can't see the text which I pass to the control(expected to see ************).
But text will be empty.
Please guide me to avoid this issue.

3 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 27 Jun 2012, 12:54 PM
Hello Chamin,

I'm assuming you're problem is in reading the value during some postback. If that is the case, are you re-creating the textbox on every postback? If not, you will need to do in order for the ViewState to sync up its values with the control.

I hope that helps.
0
Chamin
Top achievements
Rank 1
answered on 27 Jun 2012, 05:57 PM
Hi Kevin,

This is happen when initial page request is made. Not in postback only.
Actualy all other controls (radtextbox, radcombobox, radntextbox) are created on dynamically. these controls are working perfectly. I have only problem in this password radtextbox only.

Thanks & Best Regards,
Chamin
0
Vasil
Telerik team
answered on 28 Jun 2012, 08:57 AM
Hi Chamin,

Yes, in password mode the text will not be sent to client, this is done with security concern. I think the same behaviour has the asp:TextBox as well.

When you have password input in your page, you should expect the user to enter it, and you should not ever send it to the client. Moreover you should not store the password in clear view server side, and need store hash of the password, but that is a long story.

If you do some validation, for example have registration form and the user was not filled something that is required, the next postback does not send him the password, just store this password for you in the session if you like. And on the next postback if the password is empty read it from the session. Or if it is not empty, then the user has changed it, so read it from the input value.

You can set some empty message to the TextBox like and it will looks like it is filled.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
Chamin
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Chamin
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or