Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.04 KB

README.md

File metadata and controls

33 lines (22 loc) · 1.04 KB

Auto-Route

Automatically Route All Pages at Once in ASP.NET WebForms

The idea of the code behind: https://github.com/adriancs2/Auto-Route/wiki

How to Use This Library

First, add the Nuget package of adriancs.AutoRoute.

Then, add a Global Application Class into the project:

Open the file:

To route ASPX pages at specific folder:

protected void Application_Start(object sender, EventArgs e)
{
    // route all aspx pages in the project
    // scan through all folders (including folders of javascript, images, css)
    AutoRoute.RouteAllPages();

    // route all aspx pages in specific folder, including sub-folders
    AutoRoute.Route("~/pages", true);

    // route all aspx pages in specific folder, do not include pages in sub-folders
    AutoRoute.Route("~/pages", false);
}