sir,
I am developing a s/w in asp.net using c#.everything is working fine.but some times
i get error like

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 9/23/2010 4:00:35 AM
Event time (UTC): 9/23/2010 9:00:35 AM
Event ID: 4849e4d93324492b9167dcc72751f79a
Event sequence: 8
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/21803/Root/manager-4-129297060137015082
Trust level: Full
Application Virtual Path: /manager
Application Path: C:\Inetpub\vhosts\brightlightremc.com\httpdocs\manager\
Machine name: DAL11

Process information:
Process ID: 4352
Process name: w3wp.exe
Account name: DAL11\IWAM_plesk(default)

Exception information:
Exception type: CryptographicException
Exception message: Padding is invalid and cannot be removed.

Request information:
Request URL: http://brightlightremc.com/manager/WebResource.axd?d=EbAloN0I5lF5LqsBsqNpwiVKFgdQwijaDvNT2jmFbGqljQ2CzBRObAMhnlQw_IY4Agv-kHuwmya_dXe9l_fXgA2&t=634060271208718750
Request path: /manager/WebResource.axd
User host address: 118.95.35.40
User:
Is authenticated: False
Authentication Type:
Thread account name: DAL11\IWAM_plesk(default)

Thread information:
Thread ID: 10
Thread account name: DAL11\IWAM_plesk(default)
Is impersonating: False
Stack trace: at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo)
at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
----------
again after re uploading the web.config file...sometimes the error get resolved.please sir can u suggest me what modifications i need to make..

Can you post your web.config?

Cause: This error might be caused as your appdomain was recycled/restarted. Whenever this happens the application & the machine key will be set to auto, it changes. That affects the decryption of the information in the url of the resources urls (.axd).

Resolution to the cause: Setting up a fixed machine key will prevent it from ever happening again.

Reference:
Please check the URL http://www.developmentnow.com/blog/InvalidViewstate+Or+Unable+To+Validate+Data+Error.aspx for more information on a similar case in which it is explained an issue with viewstate validation, but the cause is the same one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.