the code is basic... I send the OrderID (in this case is one CART)
_orderamount = oOrder.TotalPrice;
Before this version was working fine.
What did you upgrade from. From the stack, it seems like something from 8.4.1.7 released almost 2 years ago.
The problem is, that total price is looking for a value based on the context of the request (i.e. currency and others). And all of that requires a session state which you do not have in a .ashx handler.
To solve the issue, you should change your .ashx so it implements System.Web.SessionState.IRequiresSessionState (it is just a marker interface, so no implementation is needed)
BR Nicolai
Hi Nicolai thanks for your reply.
I was using 8.7.2.4 (was working fine)
With IRequiresSessionState I need be logged in /Admin (I tested here then work fine)
But I use this ashx in the FE with users without login to get some informations from the CART
Why do you need to be logged into /admin with IRequiresSessionState?
I see no changes in the code related to the stack trace you have published. It looks at the orders total price, and to do that, it needs a context based on a session. You did not change anything at all in your code...?
NP
Hi Nicolai.
I'm back to this error...
Well, I tried add the IRequiresSessionState, but when I do this always they are return this: <script>setTimeout('top.location = "/Admin/Access/Access_Logoff.aspx";', 1000);</script>
then If I make login in Admin then is work... strange because is not fire the ProcessRequest()
If I remove the IRequiresSessionState then is work until I use the updateCart()... after that I got the error (NullReferenceException) in oOrder.TotalPrice.
I create a simple ashx (standard from Visual Studio), is work the same... with IRequiresSessionState always send to logout, without is work...
Well, that is because you are in a state/url location where login is required.
If you have placed it in /CustomModules/* or /Admin that is the case.
If you do not want login to be required, place it outside that folder.
Thats true...
Sorry.. I do that.
Thanks
No problem
You must be logged in to post in the forum