Click or drag to resize

RouteConfigRegisterRoutes Method

Puts ignore route, map route and default route

Namespace:  SOWIWeb.Foundation.App
Assembly:  SOWIWeb.Foundation (in SOWIWeb.Foundation.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static void RegisterRoutes(
	RouteCollection routes,
	string pController = "Home",
	string pAction = "Index",
	string pID = "",
	string pParameter = ""
)

Parameters

routes
Type: System.Web.RoutingRouteCollection
Provides a collection of routes for ASP.NET routing
pController (Optional)
Type: SystemString
Route default controller (Home)
pAction (Optional)
Type: SystemString
Route default action/view (Index)
pID (Optional)
Type: SystemString
Route parameter ID is optional
pParameter (Optional)
Type: SystemString
Route parameter "parameter" is optional
Remarks
It is called by MVC Application object event Application Start

The default route is: /Home/Index

Default route can has follow parameters: "id" and "parameter"

Examples
This example puts default routes in file Global.asax
/// <summary>
/// SOWI Web application. Application start event. Puts global routing.
/// </summary>
public class MvcApplication : System.Web.HttpApplication
{
    /// <summary>
    /// SOWI Web application start event: puts global routes
    /// </summary>
    /// <seealso cref="SOWIWeb.Foundation.RouteConfig"/>
    protected void Application_Start()
    {
        SOWIWeb.Foundation.RouteConfig.RegisterRoutes(RouteTable.Routes);
    }

}
See Also