encoding email address using c# and decoding using javascript in a gridview -


i new user .net forgive me if problem basic.

i have gridview displaying users information including emails. want encode these emails server side , decode them client side.

<script type="text/javascript">     function uncryptedmailto(s) {         var n = 0;         var r = "";         (var = 0; < s.length; i++) {             n = s.charcodeat(i);             if (n >= 8364) { n = 128; }             r += string.fromcharcode(n - (1));         }         return r;     }     function showemail(s) {         location.href = uncryptedmailto(s);     }  </script>   <asp:gridview id="gridview_users" runat="server"  onrowdatabound="gridview_users_rowdatabound" >     <columns>                     <asp:templatefield headertext="email" sortexpression="email">             <itemtemplate>                <a href="javascript:showemails(<%# eval("email", "mailto:{0}") %>)">write email</a>             </itemtemplate>         </asp:templatefield>     </columns> </asp:gridview> 

i want write encoding code c# don't know how value of <%# eval("email", "mailto:{0}") %> , pass back. can give me hint how that?


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -