Hello,
I am trying to pass a parameter in the querystring using this link:
"javascript
:window.open('ServiceProvider.aspx" & EncryptQueryString("id=0") & "','br','width=550,height=600');"
But when I click on the link, I get the error : Invalid Length for a Base-64 char array in the StringHelpers.
vb class in the line where the bytIn array is defined:
Public Shared Function Decrypt(ByVal encryptedString As String) As String
If encryptedString.Trim().Length <> 0 Then
' Convert from Base64 to binary
Dim bytIn As Byte() = Convert.FromBase64String(encryptedString)
' Create a MemoryStream
Dim ms As New MemoryStream(bytIn, 0, bytIn.Length)
' Create a CryptoStream that decrypts the data
Dim cs As New CryptoStream(ms, _cryptoProvider.CreateDecryptor(Key, IV), CryptoStreamMode.Read)
' Read the Crypto Stream
Dim sr As New StreamReader(cs)
Return sr.ReadToEnd()
Else
Return ""
End If
End Function
Why would that be?
The decription method works fine when I use it in the sample application, but whenever I try to add the encrypted querystiring in a javascript window.open method, it fails!
Thanks
Emmanouil Filippou