Mid From PDF MVC ASP.NET Core MVC

Exception (special case — when an error occurs) Tip: Filters with a lower Order value run first. Example: [MyActionFilter(Order = 1)] [MyLoggingFilter(Order = 2)] ⚒ 14. How do you create a custom action filter?

public class LogActionFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext

context)

{

Console.WriteLine($"Action:

{context.ActionDescriptor.DisplayName}");

}
}

Use it:

[LogActionFilter]

public IActionResult Index() => View();

📤 15. How do you pass data from controller to view?

You can use:

More from ASP.NET Core MVC Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details