c# - ASP.Net GridView - Show the last 4 digits -
in gridview, have column need masked last 4-digits. gridview:
<asp:gridview id="gridview" runat="server" autogeneratecolumns="false" borderstyle="none" borderwidth="1px" cellpadding="3" datakeynames="br_id" datasourceid="sqldatasource6"> <columns> <asp:boundfield datafield="accountnumber" headertext="account number" sortexpression="accountnumber" /> </columns> </asp:gridview>
i tried right function of sql server in sqldatasource,
`select '****-****-****' + right (accountnumber, 4)` from....
the issue is, when hit edit, , save in gridview, save in database, example: ****-****-****-1234
return 4 digits database. update the account number in database if edit account number.
if users need able see full account number defeats purpose of masking in first place.
Comments
Post a Comment