Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Maybe not an exact solution for your situation, but I've recently had to handle something similar so this might point you in the right direction.</p> <p>What I did was setup a simple route in Global.asax with a catch-all parameter which calls a custom RouteHandler class.</p> <pre><code>// Custom MVC route routes.MapRoute( "Custom", "{lang}/{*path}", new { controller = "Default", action = "Index" }, new { lang = @"fr|en" } ).RouteHandler = new ApplicationRouteHandler(); </code></pre> <p>ApplicationRouteHandler.cs :</p> <pre><code>public class ApplicationRouteHandler : IRouteHandler { /// &lt;summary&gt; /// Provides the object that processes the request. /// &lt;/summary&gt; /// &lt;param name="requestContext"&gt;An object that encapsulates information about the request.&lt;/param&gt; /// &lt;returns&gt; /// An object that processes the request. /// &lt;/returns&gt; public IHttpHandler GetHttpHandler(RequestContext requestContext) { string path = requestContext.RouteData.Values["path"] as string; // attempt to retrieve controller and action for current path Page page = GetPageData(path); // Method that returns a 404 error if (page == null) return SetupErrorHandler(requestContext, "ApplicationRouteHandler"); // Assign route values to current requestContext requestContext.RouteData.Values["controller"] = page.Controller; requestContext.RouteData.Values["action"] = page.Action; return new MvcHandler(requestContext); } } </code></pre> <p>Obviously the way you retrieve the action and controller names from your database will probably be much different than mine, but this should give you an idea.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload