本文整理汇总了C#中RouteCollection.MapPageRoute方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapPageRoute方法的具体用法?C# RouteCollection.MapPageRoute怎么用?C# RouteCollection.MapPageRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RouteCollection
的用法示例。
在下文中一共展示了RouteCollection.MapPageRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterRoutes
protected void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Bootstrap",
"Bootstrap",
"~/Bootstrap.aspx");
routes.MapPageRoute("Html5",
"Html5",
"~/Html5.aspx");
routes.MapPageRoute("jQuery",
"jQuery",
"~/jQuery.aspx");
routes.MapPageRoute("Submit",
"Submit",
"~/Submit.aspx");
routes.Add(new Route("Data/GetServerTime", new GetSeverTimeRouteHandler()));
routes.Add(new Route("Data/LongRunningProcess", new LongRunningProcessRouteHandler()));
routes.MapPageRoute("Default",
"",
"~/Default.aspx");
}
示例2: RegisterRoutes
void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute(
"HomeRoute",
"Home",
"~/Default.aspx"
);
routes.MapPageRoute(
"AboutRoute",
"About",
"~/About.aspx"
);
routes.MapPageRoute(
"ContactRoute",
"Contact",
"~/Contact.aspx"
);
routes.MapPageRoute(
"ProductListRoute",
"ProductList",
"~/ProductList.aspx"
);
routes.MapPageRoute(
"ProductsByCategoryRoute",
"ProductList/{categoryName}",
"~/ProductList.aspx"
);
routes.MapPageRoute(
"ProductByNameRoute",
"Product/{productName}",
"~/ProductDetails.aspx"
);
}
示例3: YonetimRoutes
void YonetimRoutes(RouteCollection routes)
{
routes.MapPageRoute("icerik", "{Sayfa}", "~/page.aspx", true);
routes.MapPageRoute("alt-icerik", "{Sayfa}/{AltSayfa}", "~/page.aspx", true);
routes.MapPageRoute("en-alt-icerik", "{Sayfa}/{AltSayfa}/{EnAltSayfa}", "~/page.aspx", true);
routes.MapPageRoute("link", "{Sayfa}/{AltSayfa}/{EnAltSayfa}/{Icerik}", "~/page.aspx", true);
}
示例4: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Index", "", "~/Pages/Index.aspx");
routes.MapPageRoute("IndexEditRoute", "kund/{KundID}", "~/Pages/IndexEdit.aspx");
routes.MapPageRoute("AlbumEditRoute", "album/{AlbumID}", "~/Pages/AlbumEdit.aspx");
routes.MapPageRoute("Album", "album", "~/Pages/Album.aspx");
}
示例5: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.Ignore("{resource}.axd/{*pathInfo}");
routes.MapPageRoute(
"SalesSummaryRoute",
"SalesReportSummary/{year}",
"~/SalesSummary.aspx",
true,
new RouteValueDictionary { }
);
var route = routes.MapPageRoute(
"SalesRoute",
"SalesReport/{locale}/{year}",
"~/Sales.aspx",
true,
new RouteValueDictionary { }
);
route.RouteHandler = new PageRouteHandler("~/Sales.aspx");
routes.MapPageRoute(
"ExpensesRoute",
"ExpenseReport/{locale}/{year}/{*extraInfo}",
"~/Expenses.aspx",
true,
new RouteValueDictionary { },
new RouteValueDictionary { { "extraInfo", new CharactersConstraint() } }
);
}
示例6: RegisterRoutes
void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("", "", "~/WebForm1.aspx");
routes.MapPageRoute("", "Page2", "~/WebForm2.aspx");
routes.MapPageRoute("", "Book/{category}", "~/WebForm3.aspx");
routes.MapPageRoute("404", "{*url}", "~/WebForm1.aspx"); // PageNotFound.aspx
}
示例7: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute(null, "list/{category}/{page}", "~/Pages/Listing.aspx");
routes.MapPageRoute(null, "list/{page}", "~/Pages/Listing.aspx");
routes.MapPageRoute(null, "", "~/Pages/Listing.aspx");
routes.MapPageRoute(null, "list", "~/Pages/Listing.aspx");
}
示例8: RegisterRoutes
private void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute(
"generate-flair-basic",
"Generate/options/{options}/{associationId}.{format}",
"~/Generate.aspx"
);
routes.MapPageRoute(
"generate-flair-end",
"Generate/{associationId}.{format}/options/{options}",
"~/Generate.aspx"
);
routes.MapPageRoute(
"generate-flair-forum-basic",
"Generate/{associationId}.{format}",
"~/Generate.aspx"
);
routes.MapPageRoute(
"generate-flair",
"Generate/{associationId}",
"~/Generate.aspx"
);
}
示例9: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
var def = new RouteValueDictionary(new { user = "demo" });
var reg = new RouteValueDictionary(new { user = "\\w+" });
// Register a route for Page/{User}
routes.MapPageRoute(
"user-page", // Route name
"w/{user}", // Route URL
"~/Pv.aspx", // Web page to handle route
true,
def,
reg
);
// Register a route for Page/{User}
routes.MapPageRoute(
"user-card", // Route name
"c/{user}", // Route URL
"~/Cv.aspx", // Web page to handle route
true,
def,
reg
);
// Register a route for Page/{User}
routes.MapPageRoute(
"user-imgs", // Route name
"p/{user}", // Route URL
"~/Id.aspx", // Web page to handle route
true,
def,
reg
);
}
示例10: 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", "" }});
}
示例11: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
//ignore routes for images,css,js etc
routes.MapPageRoute("Home", "control/home", "~/Default.aspx");
routes.MapPageRoute("ProductDetails", "control/products/{id}/details", "~/ViewProducts.aspx");
routes.MapPageRoute("UpdatePwd", "control/updatepwd", "~/UpdatePwd.aspx");
routes.MapPageRoute("BrowseCat", "control/browse", "~/BrowseCategories.aspx");
}
示例12: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Questions", "questions", "~/Pages/QuestionPages/QuestionList.aspx");
routes.MapPageRoute("AddQuestion", "questions/new", "~/Pages/QuestionPages/CreateQuestion.aspx");
routes.MapPageRoute("QuestionDetails", "questions/{id}", "~/Pages/QuestionPages/QuestionDetails.aspx");
routes.MapPageRoute("Default", "", "~/Pages/Game.aspx");
}
示例13: DefineRoutes
public static void DefineRoutes(RouteCollection routes)
{
routes.MapPageRoute("Default", "", "~/Pages/Default.aspx");
routes.MapPageRoute("UserList", "users/", "~/Pages/Account/UserList.aspx");;
routes.MapPageRoute("UserAction", "user/{action}/{*id}", "~/Pages/Account/UserForm.aspx");
//routes.MapPageRoute("Customer", "customer/{id}", "~/Pages/Customer/Index.aspx");
}
示例14: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Default", "Hem", "~/Default.aspx");
routes.MapPageRoute("GameList", "Spelsammling", "~/GameList.aspx");
routes.MapPageRoute("Details", "spel/{id}", "~/Details.aspx");
routes.MapPageRoute("NewGame", "Nytt spel", "~/NewGame.aspx");
routes.MapPageRoute("NewUSer", "Registrering", "~/Register.aspx");
}
示例15: RegisterRoutes
public static void RegisterRoutes(RouteCollection routes)
{
routes.EnableFriendlyUrls();
routes.MapPageRoute("rutaGenCdp", "generarCDP", "~/App/CDP/wf_generarCDP.aspx", false);
routes.MapPageRoute("rutaVerCdp", "VerCDP", "~/App/CDP/wf_VerCDP.aspx", false);
routes.MapPageRoute("rutaMantenedorwf_Region", "MantenedorRegion", "~/App/Mantenedores/wf_Regiones.aspx", false);
routes.MapPageRoute("rutaMantenedrwf_ModeloAtencion", "MantenedorModAtencion", "~/App/Mantenedores/wf_ModeloAtencion.aspx", false);
}