zoukankan      html  css  js  c++  java
  • "_appstart.cshtml" & "_pagestart.cshtml" & "_viewstart.cshtml"

    Just like you can use _AppStart.cshtml to write code before pages in the site run, you can write code that runs before (and after) any page in a particular folder run. This is useful for things like setting the same layout page for all the pages in a folder, or for checking that a user is logged in before running a page in the folder.

    For pages in particular folders, you can create code in a file named _PageStart.cshtml. The following diagram shows how the_PageStart.cshtml page works. When a request comes in for a page, ASP.NET first checks for a _AppStart.cshtml page and runs that. Then ASP.NET checks whether there's a _PageStart.cshtml page, and if so, runs that. It then runs the requested page.

    Inside the _PageStart.cshtml page, you can specify where during processing you want the requested page to run by including a RunPagemethod. This lets you run code before the requested page runs and then again after it. If you don't include RunPage, all the code in_PageStart.cshtml runs, and then the requested page runs automatically.

    http://www.asp.net/web-pages/overview/ui-layouts-and-themes/18-customizing-site-wide-behavior

  • 相关阅读:
    cf B. Sereja and Suffixes
    cf E. Dima and Magic Guitar
    cf D. Dima and Trap Graph
    cf C. Dima and Salad
    最短路径问题(floyd)
    Drainage Ditches(网络流(EK算法))
    图结构练习—BFSDFS—判断可达性(BFS)
    Sorting It All Out(拓扑排序)
    Power Network(最大流(EK算法))
    Labeling Balls(拓扑)
  • 原文地址:https://www.cnblogs.com/imust2008/p/5470356.html
Copyright © 2011-2022 走看看