Q:

How to handle login action using action filter in nopCommerce

I am using nopCommerce3.40
I have create one plugin and i want open custom page from plugin so i have used action filter and its working fine after login my custom page opened.
But some time customer enter wrong email or password so nopCommerce login event set error in ModelState.AddModelError then instantly my page call and i am just check current customer is guest so redirect login page so its work fine but error message not display because login page is reload.
In Short if Customer was not successfully login then debug point should no reach to my action and how to get ModelState is true or not in actionfilter?
please give me suggestion how to handle login action using action filter
Regards,
Jatin

A:

I got solution see code look like: In actionfilter  
 public void OnActionExecuted(ActionExecutedContext filterContext)
        {
                var viewData = filterContext.Controller.ViewData;
                if (viewData.ModelState.IsValid)
                {
                        //some code 

                }
        }

