Url路由HTML未呈现

Url路由HTML未呈现,html,asp.net,asp.net-mvc,webforms,Html,Asp.net,Asp.net Mvc,Webforms,我曾经使用过Url路由,但有时我觉得HTML代码没有呈现 这是我在Global.asax中的代码 void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } public static void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapPageRoute("

我曾经使用过Url路由,但有时我觉得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网站时,一切都很好 下图为se图像

尝试访问同一页面,但改为使用友好url 看起来像这样


有人能帮我解释一下为什么会发生这种情况吗?我确信javascript也没有呈现。

您的css样式表没有加载。发生这种情况的原因是重写,浏览器尝试从路径
/panel/assets/…
使用绝对路径加载文件以使其正常工作

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

...

好的,我明白。非常感谢我的朋友。我很高兴你发现我的回答很有帮助