2014-01-05 99 views
0

我都已經使用URL路徑,但有時我覺得像HTML代碼沒有渲染網址路線HTML渲染不

這是我在代碼的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"); 
} 

當去到aspx網站everyting正在工作正常ex http://www.dentalo.se/dashboard/login.aspx se image below enter image description here

嘗試訪問相同的pa ge,但用友好的網址代替http://www.dentalo.se/panel/logga-in 它看起來像這樣。

enter image description here 任何人都可以幫我解釋爲什麼會發生這種情況嗎?我知道確切的說,JavaScript也不是渲染。

回答

1

您的CSS樣式表未加載。發生這種情況是因爲重寫並且瀏覽器嘗試從路徑加載文件/panel/assets/...使用絕對路徑使事情發揮作用。

<link href="/dashboard/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> 
<link href="/dashboard/assets/css/metro.css" rel="stylesheet" /> 
... 
+0

好吧,我明白了。多謝了朋友。 – user3046164

+0

我很高興你發現我的答案有幫助 –