本文整理汇总了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;
}
示例2: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
routes.EnableFriendlyUrls(settings);
routes.Ignore("*.img");
}
示例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");
}
示例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 }
);
}
示例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);
}
示例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", "" }});
}
示例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()));
}
示例8: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
var settings = new FriendlyUrlSettings
{
AutoRedirectMode = RedirectMode.Permanent
};
routes.EnableFriendlyUrls(settings);
}
示例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");
}
示例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");
}
示例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();
}
示例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);
}
示例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);
}
示例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");
}
示例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+" } });
}