OK, one more problem!
The encoding happens, but when I write it to the Text property of the
Hyperlink control, it seems that ASP.NET auto converts it back to a normal
string. What is going on here? How am I supposed to keep my email
addresses from being picked up by robots if my encoding is converted back to
a normal string??
Very frustrating!
Velvet
PS: Here's the working Encoding code
public static string UniEncode(string text)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
int charCode;
for( int i = 0; i < text.Length; i++)
{
charCode = (Int32) text[i];
sb.Append(String.Format("&#{0};",charCode));
}
return sb.ToString();
}
"Velvet" <ve****@newsgroups.nospam> wrote in message
news:Oh**************@TK2MSFTNGP14.phx.gbl...
I'm trying to convert some JavaScript to C# and don't know how to get the
character code of a character in a string. in JavaScript it is as
follows:
for( i = 0; i < email.length; i++)
{
var fs = email.charCodeAt(i);
uniemail = uniemail + '&#' + fs + ';';
}
What function would replace the .charCodeAt() function?
Thanks in advance!
Velvet