Problem in displaying Password in the DataGrid Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I have a datagrid and textboxes as columns. But when i say the textbox
property as PASSWORD the * (stars) does not display in the password text box
at runtime.
But when it is a normal textbox the text gets displayed in the control.

I will be happy if someone can answer this problem.
Thanks in advance

Raghavendra
 
That's by design. The password textbox doesn't refill the value.

You can defeat the protection by adding the password as a "value" attribute.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
TextBox1.Attributes.Add("value", "thePassword")
End Sub


<asp:textbox id="TextBox1" runat="server"
textmode="Password"></asp:textbox></p>

Ken
MVP [ASP.NET]
 
Thanks for your answer.
But as I told that my textboxes are bound to the DataGrid control. should I
set the text boxes attributes in the datafill function everytime from the
code behind.
Thanks.

Ken Cox said:
That's by design. The password textbox doesn't refill the value.

You can defeat the protection by adding the password as a "value" attribute.

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
TextBox1.Attributes.Add("value", "thePassword")
End Sub


<asp:textbox id="TextBox1" runat="server"
textmode="Password"></asp:textbox></p>

Ken
MVP [ASP.NET]


Raghavendra V said:
Hi all,
I have a datagrid and textboxes as columns. But when i say the textbox
property as PASSWORD the * (stars) does not display in the password text
box
at runtime.
But when it is a normal textbox the text gets displayed in the control.

I will be happy if someone can answer this problem.
Thanks in advance

Raghavendra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top