Server Error in '/' Application.

Invalid character in a Base-64 string.

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 character in a Base-64 string.

Source Error:


Line 33:     public static string Decrypt(string val)
Line 34:     {
Line 35:         var bytes = Convert.FromBase64String(val);
Line 36:         var encBytes = System.Security.Cryptography.ProtectedData.Unprotect(bytes, new byte[0], System.Security.Cryptography.DataProtectionScope.LocalMachine);
Line 37:         return System.Text.Encoding.UTF8.GetString(encBytes);

Source File: e:\hostingspaces\afb2f89c\pssilksarees.com\wwwroot\App_Code\secureurl.cs    Line: 35

Stack Trace:


[FormatException: Invalid character in a Base-64 string.]
   System.Convert.FromBase64String(String s) +0
   secureurl.Decrypt(String val) in e:\hostingspaces\afb2f89c\pssilksarees.com\wwwroot\App_Code\secureurl.cs:35
   sliderange.Page_Load(Object sender, EventArgs e) in e:\hostingspaces\afb2f89c\pssilksarees.com\wwwroot\sliderange.aspx.cs:174
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


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