码迷,mamicode.com
首页 > Windows程序 > 详细

Visual Studio 2015 Owin+MVC+WebAPI+ODataV4+EntityFrawork+Identity+Oauth2.0+AngularJS 1.x 学习笔记之"坑"

时间:2016-01-22 14:20:50      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:

1.AngularJS route 与 MVC route 

http://www.cnblogs.com/usea/p/4211989.html

技术分享
public class SingleRoute : RouteBase
{
    public override RouteData GetRouteData(HttpContextBase httpContext)
    {
        var data = new RouteData(this, new MvcRouteHandler());
        data.Values.Add("controller", "Home");
        data.Values.Add("action", "Index");
        return data;
    }

    public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
    {
        return null;
    }
}
View Code
技术分享
public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("favicon.ico");
        routes.Add(new SingleRoute());
        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
              
    }
}
View Code

建议如果不做SEO的话可以直接使用 # 就好了,不用搞这些.

 

Visual Studio 2015 Owin+MVC+WebAPI+ODataV4+EntityFrawork+Identity+Oauth2.0+AngularJS 1.x 学习笔记之"坑"

标签:

原文地址:http://www.cnblogs.com/keatkeat/p/5150782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!