Click here to Skip to main content
15,911,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to set the boundfield format to password of a detailsview?
ASP.NET
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False">
      <Fields>
           <asp:BoundField DataField ="FIRST_NAME" HeaderText ="FIRSTNAME" InsertVisible ="False" ReadOnly ="True" SortExpression ="FIRST_NAME" />
           <asp:BoundField DataField ="SUR_NAME" HeaderText ="LASTNAME" InsertVisible ="False" ReadOnly ="True" SortExpression ="SUR_NAME" />
            <asp:BoundField DataField ="USER_NAME" HeaderText ="USERNAME" InsertVisible ="False" ReadOnly ="True"  SortExpression ="USER_NAME" />
            <asp:BoundField DataField ="password" HeaderText ="PASSWORD" InsertVisible ="False" ReadOnly ="True" SortExpression ="password"/>
             <asp:BoundField DataField ="EMAIL" HeaderText ="EMAIL" InsertVisible ="False" ReadOnly ="True"  SortExpression ="EMAIL" />
              <asp:BoundField DataField ="created" HeaderText ="CREATED" InsertVisible ="False" ReadOnly ="True"  SortExpression ="created" />
       </Fields >
  </asp:DetailsView>


please help
Posted

1 solution

Replace
C#
<asp:BoundField DataField ="password" HeaderText ="PASSWORD" InsertVisible ="False" ReadOnly ="True" SortExpression ="password"/>

with
XML
<asp:TemplateField HeaderText="Password">
        <EditItemTemplate>
          <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Text='<%# Bind("Password") %>'></asp:TextBox>
        </EditItemTemplate>
        <ItemTemplate>
          <asp:TextBox ID="TextBox2" Enabled="false" runat="server" TextMode="Password" Text='<%# Bind("Password") %>'></asp:TextBox>
        </ItemTemplate>
      </asp:TemplateField>


Hope this will help.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900