Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using textbox with password mode inside edit template of datagrid

Status
Not open for further replies.

kalyankrishna

Programmer
Dec 6, 2002
3
IN
i am unable to use a password mode textbox inside
a datagrid's edit template.

i am right now showing password column in clear text
but have to change it... any ideas?
 
check the textmode property of the textbox
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
<EditItemTemplate>
<asp:TextBox runat=&quot;server&quot; TextMode=Password MaxLength=15 Text='<%# DataBinder.Eval(Container, &quot;DataItem.Given_Name&quot;) %>'>
</asp:TextBox>

</EditItemTemplate>

It is the TextMode=Password that is the critical bit

You will still have the problem that in the normal item template, the characters will be in plain text. If this is not what you want, may I suggest this
for the item template

<ItemTemplate>
<asp:Label runat=&quot;server&quot; Text='<%# New String(&quot;*&quot;c, len(DataBinder.Eval(Container, &quot;DataItem.Given_Name&quot;))) %>'>
</asp:Label>
</ItemTemplate>

This just puts asteriks with the same length as the field

Hope this helps

Mark [openup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top