Reputation: 159
I have have using Url Route but sometimes I feel like the HTML code is not rendering
This is my code in Global.asax
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routeCollection)
{
routeCollection.MapPageRoute("LogIn", "logga-in", "~/Login.aspx");
routeCollection.MapPageRoute("Contact", "kontakt", "~/Contact.aspx");
routeCollection.MapPageRoute("About", "om", "~/About.aspx");
routeCollection.MapPageRoute("Job", "jobb", "~/Job.aspx");
routeCollection.MapPageRoute("Connect", "anslut", "~/Connect.aspx");
routeCollection.MapPageRoute("Default", "", "~/Default.aspx");
routeCollection.MapPageRoute("Booking", "bokning/{Id}", "~/Booking.aspx");
routeCollection.MapPageRoute("DashboardDefault", "panel/", "~/Dashboard/Default.aspx");
routeCollection.MapPageRoute("DashboardAbout", "panel/om", "~/Dashboard/About.aspx");
routeCollection.MapPageRoute("DashboardContact", "panel/kontakt", "~/Dashboard/Contact.aspx");
routeCollection.MapPageRoute("DashboardLogIn", "panel/logga-in", "~/Dashboard/Login.aspx");
}
When going to the aspx site everyting is working fine ex http://www.dentalo.se/dashboard/login.aspx
se image below
Trying to access the same page but with friendly url instead http://www.dentalo.se/panel/logga-in it looks like this.
Can anyone help me why this happens? I know for sure that the javascript is not rendering also.
Upvotes: 1
Views: 285
Reputation: 8079
Your css style-sheets are not loading. This happens because of the rewriting and the browser tries to load the file from the path /panel/assets/...
Use absolute path to make things work.
<link href="/dashboard/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="/dashboard/assets/css/metro.css" rel="stylesheet" />
...
Upvotes: 3