I just edited my route for the user details page to look like this:
routes.MapRoute( "UserDetails", // Route name "{controller}/{action}/{id}/{title}", // URL with parameters new { controller = "Users", action = "Details", id = UrlParameter.Optional, title = UrlParameter.Optional } // Parameter defaults );
Now that my url looks like this: localhost/Users/Details/1/ShawnMclean Images do not load both from the controller and from the site.master website. (don't know why css and javascript had the correct urls). If url localhost/Users/Details/1 , then everything loads fine.
My img in site.master and Details.aspx looks like this in the old URL:
<img src="../../Content/Images/logo3.png" />
but when url gets an extra parameter, the image is actually in ../../../Content/Images/logo3.png
Is there a way to change images and other static content urls?
asp.net-mvc asp.net-mvc-routing
Shawn mclean
source share