user3046164
user3046164

Reputation: 159

Url Route HTML not rendering

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 enter image description here

Trying to access the same page but with friendly url instead http://www.dentalo.se/panel/logga-in it looks like this.

enter image description here Can anyone help me why this happens? I know for sure that the javascript is not rendering also.

Upvotes: 1

Views: 285

Answers (1)

Tasos K.
Tasos K.

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

Related Questions