Server Error in '/' Application.

Invalid length for a Base-64 char array.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: Invalid length for a Base-64 char array.

Source Error:


Line 180:    Public Shared Function Decrypt(ByVal encrString As String) As String
Line 181:        If encrString IsNot Nothing Then
Line 182:            Dim b As Byte() = Convert.FromBase64String(encrString)
Line 183:            Dim decryptedConnectionString As String = System.Text.ASCIIEncoding.ASCII.GetString(b)
Line 184:            Return decryptedConnectionString

Source File: D:\Websites\CJMDelhi_Pro\App_Code\CommonClass.vb    Line: 182

Stack Trace:


[FormatException: Invalid length for a Base-64 char array.]
   System.Convert.FromBase64String(String s) +0
   CommonClass.Decrypt(String encrString) in D:\Websites\CJMDelhi_Pro\App_Code\CommonClass.vb:182
   PhotoGallery_Default.GetDataInRepeater() in D:\Websites\CJMDelhi_Pro\PhotoGallery\Default.aspx.vb:85
   PhotoGallery_Default.Page_Load(Object sender, EventArgs e) in D:\Websites\CJMDelhi_Pro\PhotoGallery\Default.aspx.vb:33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062