title: Trying to mask a passport number in a textbox C#
body: <p>So I have a textbox that holds the value of passport # but I need to mask out 6 of the 9 numbers with X or *.</p>
  
  <p>I dont want to save the new passport number with the masked numbers I just want to view it but not sure if that is possible with how they set up the code before hand.</p>
  
  <pre><code>&lt;asp:TextBox ID="txtPassportNumber" 
      runat="server" 
      MaxLength="9" 
      Text="&lt;%# ((TSAPassenger) Container.DataItem).Passport.DocumentNumber %&gt;" 
      Enabled="&lt;%# IsOutsideTenDayCutoff %&gt;" /&gt;
  </code></pre>
  
  <p>Code behind (button save event):</p>
  
  <pre><code>// Passport
  TextBox tmpPassportNumber = item.FindControl("txtPassportNumber") as TextBox;
  string encodedPassport = "XXXXXX" + tmpPassportNumber.Text.Remove(0, 6);
  tmpPax.Passport.DocumentNumber = (tmpPassportNumber != null) ? tmpPassportNumber.Text : string.Empty;
  </code></pre>
  
  <p>I added the encodedPassport part but it will then save that to the DB if I use it. Any suggestions?</p>