示例#1
0
 public override void RegisterRoutes(AreaRegistrationContext regContext)
 {
     regContext.MapRoute("lyniconembedded",
                         "Lynicon/Embedded/{*innerUrl}",
                         new { controller = "Embedded", action = "Index" });
     // Get dynamically generated content
     regContext.MapRoute("lynicondynamic",
                         "Lynicon/Dynamic/{action}/{urlTail}",
                         new { controller = "Dynamic" });
     regContext.AddDataRoute <List <User> >("lyniconusers",
                                            "Lynicon/Users",
                                            new { controller = "User", action = "List", view = "LyniconListDetail", listView = "UserList" },
                                            new { },
                                            new { top = "15" }, null);
     regContext.MapRoute("lyniconadmin",
                         "Lynicon/{controller}/{action}",
                         new { controller = "Ajax", action = "Index" },
                         new { controller = "Ajax|Admin|FileManager|Items|Login|Nav|Ui|Upload|UrlManager|Version" }
                         );
 }
示例#2
0
文件: RouteX.cs 项目: scbrady/lynicon
 /// <summary>
 /// Add a DataRoute to an AreaRegistractionContext with route name, url pattern, default values
 /// </summary>
 /// <typeparam name="TData">The type of the content data attached by the DataRoute</typeparam>
 /// <param name="areaReg">An AreaRegistrationContext</param>
 /// <param name="name">Name of the route table entry</param>
 /// <param name="url">The url matching pattern</param>
 /// <param name="defaults">Default values for unmatched pattern elements</param>
 /// <returns>The DataRoute that was created and registered</returns>
 static public DataRoute <TData> AddDataRoute <TData>(this AreaRegistrationContext areaReg, string name, string url, object defaults)
     where TData : class, new()
 {
     return(areaReg.AddDataRoute <TData>(name, url, defaults, null));
 }