The type 'Nop.Plugin.CRM.Zoho.ZohoRegistrarActionFilter' is not assignable to service 'System.Web.Mvc.IFilterProvider'.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi Lam Woon Cherk,

I need override another action in Admin which is "MarkOrderAsPaid" in the Admin OrderController. Do you think if it is possible?

Thanks,
Amy
8 years ago
Why not? ;)
8 years ago
so how could I get the controller from nop.Admin? Do I need get it from route?

There are six action with same actionname "Edit" and all use httppost. only difference is [FormValueRequired("markorderaspaid")].
is it possible to get the actionresult name?
8 years ago
amyniu wrote:
so how could I get the controller from nop.Admin? Do I need get it from route?


If you can do "controllerContext.Controller is CustomerController", you can also do the same to capture OrderController. Just make sure the OrderController here is referring to Nop.Admin (instead of Nop.Web).

amyniu wrote:
There are six action with same actionname "Edit" and all use httppost. only difference is [FormValueRequired("markorderaspaid")].
is it possible to get the actionresult name?


Make sure the form has "markorderaspaid" submitted. In fact, just see how FormValueRequired is written. It is itself an action filter! ;)
8 years ago
Let me try first. if I cant do it, I will ask questions.

Thanks :)
8 years ago
it is working. It seems the code is executed before the function in the controller.  is it possible to execute the override code after the function in the controller?
8 years ago
OnActionExecuted instead of OnActionExecuting. ;)
8 years ago
I got an error msg like:

Error  3  'Nop.Plugin.CRM.Zoho.ZohoMarkasPaidActionFilter.OnActionExecuted(System.Web.Mvc.ActionExecutingContext)': no suitable method found to override  C:\Users\Marketing\Itellengence Help\source code\nopCommerce_3.00_Source_2\Plugins\Nop.Plugin.CRM.Zoho\ZohoMarkasPaidActionFilter.cs  41  30  Nop.Plugin.CRM.Zoho
8 years ago
It is working well now. :)
8 years ago
Hi Lam Woon Cherk,

I found an error at the system log as below,

Object reference not set to an instance of an object.
The details for the log entry.Full message:  System.NullReferenceException: Object reference not set to an instance of an object. at Nop.Plugin.CRM.Zoho.ZohoRegistrarActionFilter.OnActionExecuting(ActionExecutingContext filterContext) at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeActionMethodFilterAsynchronously(IActionFilter filter, ActionExecutingContext preContext, Func`1 nextInChain) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<>c__DisplayClass3b.<BeginInvokeActionMethodWithFilters>b__35() at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeActionMethodFilterAsynchronously(IActionFilter filter, ActionExecutingContext preContext, Func`1 nextInChain) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<>c__DisplayClass3b.<BeginInvokeActionMethodWithFilters>b__35() at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeActionMethodFilterAsynchronously(IActionFilter filter, ActionExecutingContext preContext, Func`1 nextInChain) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<>c__DisplayClass3b.<BeginInvokeActionMethodWithFilters>b__35() at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeActionMethodFilterAsynchronously(IActionFilter filter,

this is one part of the error msg, how to check this error? I think I should define a instance. I dont know which one.

Thanks,
Amy
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.