当前位置: 首页>>代码示例>>C#>>正文


C# FriendlyUrlSettings类代码示例

本文整理汇总了C#中FriendlyUrlSettings的典型用法代码示例。如果您正苦于以下问题:C# FriendlyUrlSettings类的具体用法?C# FriendlyUrlSettings怎么用?C# FriendlyUrlSettings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FriendlyUrlSettings类属于命名空间,在下文中一共展示了FriendlyUrlSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     var settings = new FriendlyUrlSettings();
     //settings.AutoRedirectMode = RedirectMode.Permanent;
     routes.EnableFriendlyUrls(settings);
     routes.LowercaseUrls = true;
 }
开发者ID:johncoffee,项目名称:eventblock,代码行数:7,代码来源:RouteConfig.cs

示例2: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     var settings = new FriendlyUrlSettings();
     settings.AutoRedirectMode = RedirectMode.Permanent;
     routes.EnableFriendlyUrls(settings);
     routes.Ignore("*.img");
 }
开发者ID:Vyara,项目名称:Telerik-Academy,代码行数:7,代码来源:RouteConfig.cs

示例3: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     var settings = new FriendlyUrlSettings();
     //settings.AutoRedirectMode = RedirectMode.Permanent;
     routes.EnableFriendlyUrls(settings);
     routes.MapPageRoute("Root","","~/Source/HotelManager/ManagerHotel.aspx");
 }
开发者ID:nvphuong92,项目名称:dat-phong-khach-san,代码行数:7,代码来源:RouteConfig.cs

示例4: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);

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

            routes.MapRoute(
               name: "sitemap.xml",
               url: "sitemap.xml",
               defaults: new { controller = "Site", action = "SitemapXml" },
               namespaces: new[] { "venteBoisBachin2.Controllers" }
               );

            routes.MapRoute(
               name: "robots.txt",
               url: "robots.txt",
               defaults: new { controller = "Site", action = "RobotsText" },
               namespaces: new[] { "venteBoisBachin2.Controllers" }
               );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:microbens1,项目名称:venteBoisBachin2,代码行数:28,代码来源:RouteConfig.cs

示例5: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     var settings = new FriendlyUrlSettings();
     //settings.AutoRedirectMode = RedirectMode.Permanent;       //comment by sourav
     settings.AutoRedirectMode = RedirectMode.Off;
     routes.EnableFriendlyUrls(settings);
 }
开发者ID:souravmondals,项目名称:shopingcart-three-tire,代码行数:7,代码来源:RouteConfig.cs

示例6: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);

            // First parameter: Name of route
            // Second parameter: URL of route {variables}
            // Third parameter: Default values
            // Fourth parameter: Contraints (optional)

            // Profile/username Route
            routes.MapPageRoute("Profile",
            "Account/Profile/{username}",
            "~/Account/Profile/Profile.aspx", true,
            new RouteValueDictionary { 
                { "username", "" } });

            // Profile/username/AccountInfo Route
            routes.MapPageRoute("ProfileAccountDetails",
            "Account/Profile/{username}/{accountDetails}",
            "~/Account/Profile/AccountDetails.aspx", true,
            new RouteValueDictionary { 
                { "username", "" },
                { "accountDetails", "" }});
        }
开发者ID:apawelczyk,项目名称:Sportfare,代码行数:26,代码来源:RouteConfig.cs

示例7: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Off;
            routes.EnableFriendlyUrls(settings);

            routes.Add(new Route("{imageID}", new RouteHandler()));
        }
开发者ID:ICOMMKT,项目名称:WebSiteToJpg,代码行数:8,代码来源:RouteConfig.cs

示例8: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     var settings = new FriendlyUrlSettings
     {
         AutoRedirectMode = RedirectMode.Permanent
     };
     routes.EnableFriendlyUrls(settings);
 }
开发者ID:jinzesudawei,项目名称:WebMarkupMin,代码行数:8,代码来源:RouteConfig.cs

示例9: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
              settings.AutoRedirectMode = RedirectMode.Permanent;
              // routes.EnableFriendlyUrls(settings);

              routes.MapPageRoute("scenarioDefault", "tests", "~/Scenarios/Default.aspx");
        }
开发者ID:KathleenDollard,项目名称:WebFormsTest,代码行数:8,代码来源:RouteConfig.cs

示例10: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            //settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);

            routes.MapPageRoute("Timeline", "Timeline/{*Catalog}", "~/Views/SocialMediaSystem/Timeline.aspx");
        }
开发者ID:djdino56,项目名称:ICT4Events-Web,代码行数:8,代码来源:RouteConfig.cs

示例11: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     var settings = new FriendlyUrlSettings();
     settings.AutoRedirectMode = RedirectMode.Permanent;
     routes.EnableFriendlyUrls(settings);
     //Commenting the above code and using the below line gets rid of the master mobile site.
     //routes.EnableFriendlyUrls();
 }
开发者ID:GeraldBecker,项目名称:TechProFantasySoccer,代码行数:8,代码来源:RouteConfig.cs

示例12: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     /** TODO :
     *    1.Try to configure routes
     */
     var settings = new FriendlyUrlSettings();
     settings.AutoRedirectMode = RedirectMode.Permanent;
     routes.EnableFriendlyUrls(settings);
 }
开发者ID:Warshavski,项目名称:Nosology,代码行数:9,代码来源:RouteConfig.cs

示例13: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapPageRoute("Login",
            "login", "~/Account/Login.aspx");

            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);
        }
开发者ID:TelerikWebFormsOrganization,项目名称:SimpleBlogSystem,代码行数:9,代码来源:RouteConfig.cs

示例14: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);

            routes.MapPageRoute("survey", "survey/{surveyUrl}", "~/Survey/Default.aspx");
            routes.MapPageRoute("surveyform", "surveyform/{surveyUrl}", "~/Survey/SurveyPage.aspx");
        }
开发者ID:deveshs22,项目名称:SurveyPortal,代码行数:9,代码来源:RouteConfig.cs

示例15: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            //friendly url
            var settings = new FriendlyUrlSettings
            {
                AutoRedirectMode = RedirectMode.Permanent,
                ResolverCachingMode = ResolverCachingMode.Dynamic
            };
            routes.EnableFriendlyUrls(settings);
            //ignore routes
            routes.Ignore("{resource}.axd/{*pathInfo}");
            // routs
            routes.MapPageRoute("EditArticle", "User/Articles/Edit/{id}",
               "~/Managements/Articles/Edit.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" } });
            routes.MapPageRoute("DeleteArticle", "User/Articles/Delete/{id}",
             "~/Managements/Articles/Delete.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" } });
            routes.MapPageRoute("ShowArticles", "User/Articles/Show",
             "~/Managements/Articles/Default.aspx", true, null, null);
            routes.MapPageRoute("InsertArticle", "User/Articles/Insert",
               "~/Managements/Articles/Insert.aspx", true, null, null);

            routes.MapPageRoute("DeleteComment", "Forum/Topic/{topicId}/post/Comments/{id}",
             "~/Managements/Comments/Delete.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" }, { "topicId", @"\d+" } });
            routes.MapPageRoute("AddComment", "Forum/Topic/{topicId}/post/{postId}/NewComment",
              "~/Managements/Comments/Insert.aspx", true, null, new RouteValueDictionary { { "postId", @"\d+" }, { "topicId", @"\d+" } });

            routes.MapPageRoute("DeletePost", "Forums/Topic/{topicId}/Posts/Delete/{id}",
               "~/Managements/ForumPost/Delete.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" }, { "topicId", @"\d+" } });
            routes.MapPageRoute("EditPost", "Forums/Topic/{topicId}/Posts/Edit/{id}",
               "~/Managements/ForumPost/Edit.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" },  { "topicId", @"\d+" } });

            routes.MapPageRoute("ChangePass", "User/ChangePass", "~/Account/ChangePass.aspx", true);
            routes.MapPageRoute("Confirm", "Confirm", "~/Account/Confirm.aspx", true);
            routes.MapPageRoute("login", "Login", "~/Account/Login.aspx", true);
            routes.MapPageRoute("ShowPost", "Forums/Topic/{topicId}/Posts", "~/Managements/ForumPost/Default.aspx", true,
                null, new RouteValueDictionary { { "topicId", @"\d+" } });

            routes.MapPageRoute("ShowMsg", "User/Conversation/{id}/Messages", "~/Account/ShowMessages.aspx", true,
                new RouteValueDictionary { { "id", "" } }, new RouteValueDictionary { { "id", @"\d+" } });
            routes.MapPageRoute("EditForum", "Forum/Edit/{id}", "~/Managements/Forum/Edit.aspx", true, null,
                new RouteValueDictionary { { "id", @"\d+" } });
            routes.MapPageRoute("DeleteForum", "Forum/Delete/{id}", "~/Managements/Forum/Delete.aspx", true, null,
                new RouteValueDictionary { { "id", @"\d+" } });
            routes.MapPageRoute("InsertForum", "Forum/Insert", "~/Managements/Forum/Insert.aspx", true);

            routes.MapPageRoute("DeleteTopic", "Forums/{forumId}/Topics/Delete/{id}",
                "~/Managements/ForumTopic/Delete.aspx", true, null,
                new RouteValueDictionary { { "id", @"\d+" }, { "forumId", @"\d+" } });
            routes.MapPageRoute("EditTopic", "Forums/{forumId}/Topics/Edit/{id}/{fromPost}",
                "~/Managements/ForumTopic/Edit.aspx", true, new RouteValueDictionary { { "fromPost",0 } }, new RouteValueDictionary { { "id", @"\d+" }, { "forumId", @"\d+" }, { "fromPost", @"\d+" } });
            routes.MapPageRoute("CreateTopic", "Forums/{id}/Topics/NewTopic", "~/Managements/ForumTopic/Insert.aspx", true);

            routes.MapPageRoute("Profile", "Profile/{id}", "~/Account/PublicProfile.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" } });
            routes.MapPageRoute("MainForum", "Forum", "~/Managements/Forum/Default.aspx", true);
            routes.MapPageRoute("SubForums", "Forums/{id}", "~/Managements/ForumTopic/Default.aspx", true, null, new RouteValueDictionary { { "id", @"\d+" } });
        }
开发者ID:rabbal,项目名称:AspNetWebForms-Forum,代码行数:56,代码来源:RouteConfig.cs


注:本文中的FriendlyUrlSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。