How to prevent this error in aspx page in c# ?
Message: Invalid length for a Base-64 char array.
On this code behind line :
byte[] clearBytes = Encoding.Unicode.GetBytes(clearText);
In Google search
I have find this:
The problem seems to be with the ViewState.
The ViewState is encrypted, and when an attempt is made to decrypt it on postback, the error is triggered.
I have tried this solution in the web.config file, on set ViewState not to be encrypted without success, like this:
<system.web>
<pages viewStateEncryptionMode=”Never”>
</pages>
</system.web>
Please help me, thank you so much in advance.