zoukankan      html  css  js  c++  java
  • MVC下的Area区域知识点

    新建area区域

    1.如果与根目录下的url相同,那么需要在RouteConfig.cs

    public static void RegisterRoutes(RouteCollection routes) {

        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

     

        routes.MapRoute(

            name: "Default",

            url: "{controller}/{action}/{id}",

            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },

            namespaces: new[] { "MvcApplication1.Controllers" }加上对应的namespaces参数

    命名空间               你的项目的名字    

        );

    }

    2.Area区域指向其他地方的链接:

     <div>

            <h1>admin reaa Index</h1>

            指向当前区域的链接

            @Html.ActionLink("本区域","About")

            <a href="/Admin/Home/About">Click me</a>

            指向其他(Support)区域的链接

            @Html.ActionLink("其他区域", "Index", new { area="Support"})

            <a href="/Support/Home/Index">Click me to go to another area</a>

            指向根目录下的链接

            @Html.ActionLink("abc", "Index", new { area=""})

            <a href="/Home/Index">Click me to go to top-level part</a>

    1.</div>

  • 相关阅读:
    PAT 1032 (未完成)
    PAT 1031
    PAT 1030
    将爬取到的数据存入数据框并导出
    XPath常见用法
    python 图表
    Protobuf在Unity中的通讯使用
    ProtoBuf在Unity中的使用
    Unity更新资源代码
    匿名函数
  • 原文地址:https://www.cnblogs.com/LZXX/p/5828573.html
Copyright © 2011-2022 走看看