Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic URL route
    text
    copied!<p>This app has several routes configured in RouteConfig.cs. For instance, I have the two following routes defined:</p> <pre><code>routes.MapRoute( name: "MyPage-Demo", url: "pages/page-title/demo", defaults: new { controller = "Root", action = "PageDemo" } ); routes.MapRoute( name: "MyPage", url: "pages/page-title/{resource}", defaults: new { controller = "Root", action = "Page", resource = UrlParameter.Optional } ); </code></pre> <p>Each page someone visits has a link to a "demo". A page could be accessed by visiting <code>http://localhost/pages/page-title</code>. This works fine.</p> <p>When a user clicks the "demo" link, they are redirected to a page located at <code>http://localhost/pages/page-title/demo</code>. This works fine.</p> <p>My problem is the demo page may reference a complex nested structure. The structure consists of JavaScript, css, images, etc. Content used for the purpose of the demo. None of these nested resources can be found. However, I'm not sure how to setup my routing to account for these nested files. </p> <p>I'm confident I'm going to need to update my controller's <code>PageDemo</code> action. However, I'm not sure </p> <p>a) how to do so in a way that will allow for differing structures and </p> <p>b) how to update my route configuration to account for these nested structures.</p> <p>Is there a way to do this? In reality, I'm going to have multiple pages and multiple demos. For that reason, I want to have something a little more reusable than a hard-coded approach. </p>
 

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