我有一个登录页面,根本没有加载任何CSS。这是因为该页面正在寻找以下内容:
我的wwwroot文件夹的结构为class Music : Content {
override fun <T : Content> cloneMe(): T {
return Video() as T
}
}
,但页面正在尝试使用Controller的名称(css/login/login.css
)作为前缀。 Page的头部看起来像这样:
AuthController
我的控制器位于名为<head>
<meta charset="utf-8">
<title>My Webpage</title>
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="css/login/login.css">
</head>
的文件夹中,我的视图结构如下:Controllers
。
我目前尚未使用Views/Auth/
页面。
之前我还没有看到这个,我无法解释为什么它将控制器名称添加到_Layout
中的内容前面。
答案 0 :(得分:0)
尝试将您的风格设为
{
"status" : "SUCCESS",
"code" : "00",
"businessErrorReason" : null,
"technicalErrorReason" : null,
"symphonyPolicyDetail" : {
"requestType" : "IDRC",
"symphonyPolicyDetails" : {
"verb" : null,
"hyphen" : null,
"window" : null,
"time" : 0,
"app_type" : null,
"illus_type" : null,
"page_no" : null,
"tot_no_bytes" : 0,
"policy_number" : 0,
"vers_number" : 0,
"return_code" : null,
"pending_sw" : null,
"recovery_page" : null,
"compression" : null,
"trailer_len" : null,
"insured_name" : "XXXXXXXXX*XXXXXX ",
"issue_mo" : 1,
"issue_day" : 3,
"issue_yr" : 2011,
"attained_age" : 36,
"net_premium1" : 87725,
"net_premium2" : 0,
"net_premium3" : 0,
"net_premium4" : 0,
"modal_perm" : 87725,
"base_premium" : 57860,
"sex" : "F",
"state" : "NJ",
"state_wr" : "NJ",
"plan_series" : "7B",
"plan_type" : "L",
"occ_class" : "6AM",
"rating" : 0,
"class1" : "N",
"prem_mode" : "A",
"tax_benefit" : 0,
"base_benefit" : 2000,
"base_ben_per" : 70,
"base_elim_per" : 365,
"sss_premium" : 29865,
"sss_benefit" : 1500,
"sss_elim_per" : 365,
"aib_amt_1" : 0,
"aib_ben_per_1" : 0,
"aib_amt_2" : 0,
"aib_ben_per_2" : 0,
"aib_sss_amt" : 0,
"aib_sss_ben_per" : 0,
"tax_disc" : 0,
"er_exp_disc" : 0,
"er_gsi_disc" : 0,
"er_gti_disc" : 0,
"er_disc" : 0,
"er_plus_disc" : 0,
"assoc_disc" : 0,
"select_occ_disc" : 0,
"mental_nerv_disc" : 0,
"afl_disc" : 0,
"total_discount_amt" : 0,
"cola_type" : 0,
"cola_prem" : 0,
"reg_occ_type" : 0,
"reg_occ_prem" : 0,
"ben_updt" : 0,
"abi" : 0,
"rtw_prem" : 0,
"res_dis_prem" : 0,
"part_disb_prem" : 0,
"lifetime_prem" : 0,
"pro_prem" : 0,
"pro_term_return" : "0000",
"pro_perm_ret" : 0,
"dividend" : 0,
"net_prem_beg_yr_2" : 0,
"net_prem_end_yr_2" : 0,
"net_prem_beg_yr_3" : 0,
"net_prem_end_yr_3" : 0,
"net_prem_beg_yr_4" : 0,
"net_prem_end_yr_4" : 0,
"total_disc_pct" : 0,
"eff_date_mo" : 1,
"eff_date_slash" : "/",
"eff_date_yr" : 2018,
"next_ann_mo" : 1,
"next_ann_slash" : "/",
"next_ann_yr" : 2018,
"occ_code" : 320,
"rte" : 0,
"etdb_prem" : 0,
"etdb_factor" : 0,
"rbr_prem" : 0,
"rbr_ben_per" : 0,
"stdb_prem" : 0,
"stdb_ben_per" : 0,
"cdb_benefit" : 0,
"cdb_ben_per" : 0,
"cdb_elim_per" : 0,
"cdb_prem" : 0,
"aio" : 0,
"your_occ_ben_per" : 70,
"tocc_ben_per" : 0,
"claim_code" : 0,
"mode_factor_code" : 3,
"pdto_mo" : 1,
"pdto_slash" : "/",
"pdto_yr" : 2012,
"cap" : 1,
"pdb" : 1,
"crp" : 0,
"fbi" : 0,
"issue_age" : 30,
"shb" : 0,
"multi_life" : 0,
"resr" : 0,
"filler" : " ",
"error_message_info" : " "
},
"symphonyPolicy" : null
}
}
类似于如何引用相对路径(例如: <link rel="stylesheet" href="~/css/login/login.css">
),您可以在Razor中使用../css/login/login.css
运算符引用虚拟根路径。
通常我发现~
更有用,因为您可以更改视图的位置并仍然引用相同的位置。