Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionExecutingContext.IsChildAction equivalent in ASP.Net Core MVC

I'm currently porting a MVC 5 app that require to detect if the current controller action is not a "child action".

public class MyController : Controller
{
    protected override void OnActionExecuting(ActionExecutingContext filterContext)
    {
        if (!filterContext.IsChildAction) {
            // Do something if not a child action
        }
    }   
}

Is there another way to do it in MVC Core ? or is there a redesign in MVC Core that disable this "notion" ?

like image 258
aprovent Avatar asked Oct 15 '25 18:10

aprovent


1 Answers

I finally found more information about MVC 6 Child Actions replacement here: Goodbye Child Actions, Hello View Components

Hope it will help someone.

like image 157
aprovent Avatar answered Oct 17 '25 13:10

aprovent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!