i tried to check your code.
but it's working fine, so i think there is some thing wrong to your another code for sending query string or anything else.
i test it like this and it will working fine.
private static string EncodeTo64UTF8(string str)
{
byte[] toEncode2Bytes = System.Text.Encoding.UTF8.GetBytes(str);
string sReturnValue = System.Convert.ToBase64String(toEncode2Bytes);
return sReturnValue;
}
private static string DecodeTo64UTF8(string eValue)
{
byte[] encodedDataBytes = System.Convert.FromBase64String(eValue);
string sReturnValue = System.Text.Encoding.UTF8.GetString(encodedDataBytes);
return sReturnValue;
}
protected void EncodeDecodTest()
{
string str = "id=43&name='xyz'";
string encode = EncodeTo64UTF8(str);
string decode = DecodeTo64UTF8(encode);
}