Home All Groups Group Topic Archive Search About

Webresource.axd problem in asp.net 2.0

Author
29 Dec 2005 10:06 PM
awyl
I tried to use validation in asp.net 2.0 with the following code.

<%@ Page Language="c#" %>
<html>
<body>
<form runat="server">
<asp:TextBox ID="abc" runat="server">
</asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="abc"
runat="server"></asp:RequiredFieldValidator>
<asp:LinkButton runat="server">click</asp:LinkButton>
</form>
</body>
</html>

I got the javascript error:
"Error: WebForm_DoPostBackWithOptions is not defined
Source File: javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("ctl02", "", true, "", "", false, true))"

Then I view source and found script tags loading external javascript files.

I tried to load it directly in the browser and it showed me this error.

URL: http://localhost/WebResource.axd?d=CRPh045yFpljm8l46VDATQ2&t=632664526791296187

ERROR:
System.Security.Cryptography.CryptographicException: Padding is invalid and
cannot be removed.

I googled but I cannot find an answer.

I would really appreciate if anyone could help.  Thanks!!!

Author
29 Dec 2005 10:21 PM
Jim Cheshire
awyl wrote:
>
> ERROR:
> System.Security.Cryptography.CryptographicException: Padding is
> invalid and cannot be removed.
>

Is this on a web farm by any chance?

--
Jim Cheshire
================================
Blog: http://blogs.msdn.com/jamesche

Latest entry: Digging into Objects
Describes the details of digging into
memory usage with the debugger.
Author
30 Dec 2005 4:23 PM
awyl
Nope, this is not on a web farm.

There is no compression enabled and the error appears on all the
workstations.  OS is Windows XP.



Show quote
"Jim Cheshire" wrote:

> awyl wrote:
> >
> > ERROR:
> > System.Security.Cryptography.CryptographicException: Padding is
> > invalid and cannot be removed.
> >
>
> Is this on a web farm by any chance?
>
> --
> Jim Cheshire
> ================================
> Blog: http://blogs.msdn.com/jamesche
>
> Latest entry: Digging into Objects
> Describes the details of digging into
> memory usage with the debugger.
>
>
>
>
Author
30 Dec 2005 5:18 PM
awyl
The following is the error reported in Event Log.

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 12/29/2005 4:04:49 PM
Event time (UTC): 12/29/2005 9:04:49 PM
Event ID: f24380656ff348b084581c452563e1e9
Event sequence: 50
Event occurrence: 1
Event detail code: 0

Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-127803636758088750
    Trust level: Full
    Application Virtual Path: /
    Application Path: G:\NYCweb05\WEBROOT\
    Machine name: NYC02

Process information:
    Process ID: 3408
    Process name: aspnet_wp.exe
    Account name: NYC02\ASPNET

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

Request information:
    Request URL:
http://localhost/webresource.axd?d=crph045yfpljm8l46vdatq2&t=632664526791296187
    Request path: /webresource.axd
    User host address: 127.0.0.1
    User: 
    Is authenticated: False
    Authentication Type: 
    Thread account name: NYC02\ASPNET

Thread information:
    Thread ID: 5
    Thread account name: NYC02\ASPNET
    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, Boolean
useValidationSymAlgo)
   at System.Web.UI.Page.DecryptString(String s)
   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)


Custom event details:

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.


Show quote
"awyl" wrote:

> I tried to use validation in asp.net 2.0 with the following code.
>
> <%@ Page Language="c#" %>
> <html>
> <body>
> <form runat="server">
> <asp:TextBox ID="abc" runat="server">
> </asp:TextBox>
> <asp:RequiredFieldValidator ControlToValidate="abc"
> runat="server"></asp:RequiredFieldValidator>
> <asp:LinkButton runat="server">click</asp:LinkButton>
> </form>
> </body>
> </html>
>
> I got the javascript error:
> "Error: WebForm_DoPostBackWithOptions is not defined
> Source File: javascript:WebForm_DoPostBackWithOptions(new
> WebForm_PostBackOptions("ctl02", "", true, "", "", false, true))"
>
> Then I view source and found script tags loading external javascript files.
>
> I tried to load it directly in the browser and it showed me this error.
>
> URL:
> http://localhost/WebResource.axd?d=CRPh045yFpljm8l46VDATQ2&t=632664526791296187
>
> ERROR:
> System.Security.Cryptography.CryptographicException: Padding is invalid and
> cannot be removed.
>
> I googled but I cannot find an answer.
>
> I would really appreciate if anyone could help.  Thanks!!!
>
Author
3 Jan 2006 10:42 PM
Lance Davis
I am receiving the same error on my production server, but not on my
development machine.  Were there any solutions posted to this problem?

Show quote
"awyl" wrote:

> The following is the error reported in Event Log.
>
> Event code: 3005
> Event message: An unhandled exception has occurred.
> Event time: 12/29/2005 4:04:49 PM
> Event time (UTC): 12/29/2005 9:04:49 PM
> Event ID: f24380656ff348b084581c452563e1e9
> Event sequence: 50
> Event occurrence: 1
> Event detail code: 0

> Application information:
>     Application domain: /LM/W3SVC/1/ROOT-1-127803636758088750
>     Trust level: Full
>     Application Virtual Path: /
>     Application Path: G:\NYCweb05\WEBROOT\
>     Machine name: NYC02

> Process information:
>     Process ID: 3408
>     Process name: aspnet_wp.exe
>     Account name: NYC02\ASPNET

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

> Request information:
>     Request URL:
> http://localhost/webresource.axd?d=crph045yfpljm8l46vdatq2&t=632664526791296187
>     Request path: /webresource.axd
>     User host address: 127.0.0.1
>     User: 
>     Is authenticated: False
>     Authentication Type: 
>     Thread account name: NYC02\ASPNET

> Thread information:
>     Thread ID: 5
>     Thread account name: NYC02\ASPNET
>     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, Boolean
> useValidationSymAlgo)
>    at System.Web.UI.Page.DecryptString(String s)
>    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)


> Custom event details:
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
>
>
> "awyl" wrote:
>
> > I tried to use validation in asp.net 2.0 with the following code.
> >
> > <%@ Page Language="c#" %>
> > <html>
> > <body>
> > <form runat="server">
> > <asp:TextBox ID="abc" runat="server">
> > </asp:TextBox>
> > <asp:RequiredFieldValidator ControlToValidate="abc"
> > runat="server"></asp:RequiredFieldValidator>
> > <asp:LinkButton runat="server">click</asp:LinkButton>
> > </form>
> > </body>
> > </html>
> >
> > I got the javascript error:
> > "Error: WebForm_DoPostBackWithOptions is not defined
> > Source File: javascript:WebForm_DoPostBackWithOptions(new
> > WebForm_PostBackOptions("ctl02", "", true, "", "", false, true))"
> >
> > Then I view source and found script tags loading external javascript files.
> >
> > I tried to load it directly in the browser and it showed me this error.
> >
> > URL:
> > http://localhost/WebResource.axd?d=CRPh045yFpljm8l46VDATQ2&t=632664526791296187
> >
> > ERROR:
> > System.Security.Cryptography.CryptographicException: Padding is invalid and
> > cannot be removed.
> >
> > I googled but I cannot find an answer.
> >
> > I would really appreciate if anyone could help.  Thanks!!!
> >
Author
4 Jan 2006 3:09 PM
Lance Davis
Update:  I was able to solve my own problem.  I am using a third party
product on my Web Server called SecureIIS (by eeye.com).  When I went into
SecureIIS and disabled the security for the website in question, my
JavaScript / WebResource.axd - 404 error went away, re-securing the site
brought the error back.  Feeling that my SecureIIS program was unhappy with
the fact that the WebResource.axd file didn't physically exist in the root
folder, I went ahead and created a blank text file and named it
"WebResource.axd".   No more errors.

Hope this might help someone.

Show quote
"Lance Davis" wrote:

> I am receiving the same error on my production server, but not on my
> development machine.  Were there any solutions posted to this problem?
>
> "awyl" wrote:
>
> > The following is the error reported in Event Log.
> >
> > Event code: 3005
> > Event message: An unhandled exception has occurred.
> > Event time: 12/29/2005 4:04:49 PM
> > Event time (UTC): 12/29/2005 9:04:49 PM
> > Event ID: f24380656ff348b084581c452563e1e9
> > Event sequence: 50
> > Event occurrence: 1
> > Event detail code: 0
> > 
> > Application information:
> >     Application domain: /LM/W3SVC/1/ROOT-1-127803636758088750
> >     Trust level: Full
> >     Application Virtual Path: /
> >     Application Path: G:\NYCweb05\WEBROOT\
> >     Machine name: NYC02
> > 
> > Process information:
> >     Process ID: 3408
> >     Process name: aspnet_wp.exe
> >     Account name: NYC02\ASPNET
> > 
> > Exception information:
> >     Exception type: CryptographicException
> >     Exception message: Padding is invalid and cannot be removed.
> > 
> > Request information:
> >     Request URL:
> > http://localhost/webresource.axd?d=crph045yfpljm8l46vdatq2&t=632664526791296187
> >     Request path: /webresource.axd
> >     User host address: 127.0.0.1
> >     User: 
> >     Is authenticated: False
> >     Authentication Type: 
> >     Thread account name: NYC02\ASPNET
> > 
> > Thread information:
> >     Thread ID: 5
> >     Thread account name: NYC02\ASPNET
> >     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, Boolean
> > useValidationSymAlgo)
> >    at System.Web.UI.Page.DecryptString(String s)
> >    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)
> > 
> > 
> > Custom event details:
> >
> > For more information, see Help and Support Center at
> > http://go.microsoft.com/fwlink/events.asp.
> >
> >
> > "awyl" wrote:
> >
> > > I tried to use validation in asp.net 2.0 with the following code.
> > >
> > > <%@ Page Language="c#" %>
> > > <html>
> > > <body>
> > > <form runat="server">
> > > <asp:TextBox ID="abc" runat="server">
> > > </asp:TextBox>
> > > <asp:RequiredFieldValidator ControlToValidate="abc"
> > > runat="server"></asp:RequiredFieldValidator>
> > > <asp:LinkButton runat="server">click</asp:LinkButton>
> > > </form>
> > > </body>
> > > </html>
> > >
> > > I got the javascript error:
> > > "Error: WebForm_DoPostBackWithOptions is not defined
> > > Source File: javascript:WebForm_DoPostBackWithOptions(new
> > > WebForm_PostBackOptions("ctl02", "", true, "", "", false, true))"
> > >
> > > Then I view source and found script tags loading external javascript files.
> > >
> > > I tried to load it directly in the browser and it showed me this error.
> > >
> > > URL:
> > > http://localhost/WebResource.axd?d=CRPh045yFpljm8l46VDATQ2&t=632664526791296187
> > >
> > > ERROR:
> > > System.Security.Cryptography.CryptographicException: Padding is invalid and
> > > cannot be removed.
> > >
> > > I googled but I cannot find an answer.
> > >
> > > I would really appreciate if anyone could help.  Thanks!!!
> > >
Author
5 Jan 2006 6:10 PM
awyl
I tried your solution.  However the problem still exists after I created a
blank file with the name "WebResource.axd" in the webroot.

Show quote
"Lance Davis" wrote:

> Update:  I was able to solve my own problem.  I am using a third party
> product on my Web Server called SecureIIS (by eeye.com).  When I went into
> SecureIIS and disabled the security for the website in question, my
> JavaScript / WebResource.axd - 404 error went away, re-securing the site
> brought the error back.  Feeling that my SecureIIS program was unhappy with
> the fact that the WebResource.axd file didn't physically exist in the root
> folder, I went ahead and created a blank text file and named it
> "WebResource.axd".   No more errors.
>
> Hope this might help someone.
>
> "Lance Davis" wrote:
>
> > I am receiving the same error on my production server, but not on my
> > development machine.  Were there any solutions posted to this problem?
> >
> > "awyl" wrote:
> >
> > > The following is the error reported in Event Log.
> > >
> > > Event code: 3005
> > > Event message: An unhandled exception has occurred.
> > > Event time: 12/29/2005 4:04:49 PM
> > > Event time (UTC): 12/29/2005 9:04:49 PM
> > > Event ID: f24380656ff348b084581c452563e1e9
> > > Event sequence: 50
> > > Event occurrence: 1
> > > Event detail code: 0
> > > 
> > > Application information:
> > >     Application domain: /LM/W3SVC/1/ROOT-1-127803636758088750
> > >     Trust level: Full
> > >     Application Virtual Path: /
> > >     Application Path: G:\NYCweb05\WEBROOT\
> > >     Machine name: NYC02
> > > 
> > > Process information:
> > >     Process ID: 3408
> > >     Process name: aspnet_wp.exe
> > >     Account name: NYC02\ASPNET
> > > 
> > > Exception information:
> > >     Exception type: CryptographicException
> > >     Exception message: Padding is invalid and cannot be removed.
> > > 
> > > Request information:
> > >     Request URL:
> > > http://localhost/webresource.axd?d=crph045yfpljm8l46vdatq2&t=632664526791296187
> > >     Request path: /webresource.axd
> > >     User host address: 127.0.0.1
> > >     User: 
> > >     Is authenticated: False
> > >     Authentication Type: 
> > >     Thread account name: NYC02\ASPNET
> > > 
> > > Thread information:
> > >     Thread ID: 5
> > >     Thread account name: NYC02\ASPNET
> > >     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, Boolean
> > > useValidationSymAlgo)
> > >    at System.Web.UI.Page.DecryptString(String s)
> > >    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)
> > > 
> > > 
> > > Custom event details:
> > >
> > > For more information, see Help and Support Center at
> > > http://go.microsoft.com/fwlink/events.asp.
> > >
> > >
> > > "awyl" wrote:
> > >
> > > > I tried to use validation in asp.net 2.0 with the following code.
> > > >
> > > > <%@ Page Language="c#" %>
> > > > <html>
> > > > <body>
> > > > <form runat="server">
> > > > <asp:TextBox ID="abc" runat="server">
> > > > </asp:TextBox>
> > > > <asp:RequiredFieldValidator ControlToValidate="abc"
> > > > runat="server"></asp:RequiredFieldValidator>
> > > > <asp:LinkButton runat="server">click</asp:LinkButton>
> > > > </form>
> > > > </body>
> > > > </html>
> > > >
> > > > I got the javascript error:
> > > > "Error: WebForm_DoPostBackWithOptions is not defined
> > > > Source File: javascript:WebForm_DoPostBackWithOptions(new
> > > > WebForm_PostBackOptions("ctl02", "", true, "", "", false, true))"
> > > >
> > > > Then I view source and found script tags loading external javascript files.
> > > >
> > > > I tried to load it directly in the browser and it showed me this error.
> > > >
> > > > URL:
> > > > http://localhost/WebResource.axd?d=CRPh045yFpljm8l46VDATQ2&t=632664526791296187
> > > >
> > > > ERROR:
> > > > System.Security.Cryptography.CryptographicException: Padding is invalid and
> > > > cannot be removed.
> > > >
> > > > I googled but I cannot find an answer.
> > > >
> > > > I would really appreciate if anyone could help.  Thanks!!!
> > > >
Author
6 Jan 2006 12:36 AM
Jim Cheshire
awyl wrote:
> I tried your solution.  However the problem still exists after I
> created a blank file with the name "WebResource.axd" in the webroot.
>

The WebResource.axd is a handler in 2.0 that serves specific client code. It
does not physically exist and you should not add it manually.

--
Jim Cheshire
================================
Blog: http://blogs.msdn.com/jamesche

Latest entry:
Getting the PID and TID of a COM Call

Describes how to get the PID of the
dllhost process a COM call is executing
in and how to locate the thread as well.

AddThis Social Bookmark Button