在WebForm中,我们可以在MasterPage.cs中编写一个方法,并在每个请求中运行.
例如:
MasterPage.cs
--------------
protected void Page_Load(object sender, EventArgs e)
{
CheckCookie();
}
Run Code Online (Sandbox Code Playgroud)
我们怎么能在MVC中做这样的事情?
@Html.ActionAsp.net Core 在哪里?我可以看到@Html.ActionLink但不像以前那样直接调用Action.
它被ViewComponents取代了吗?