0
У меня есть следующая бритва, но если я перейду непосредственно к URL-адресу, он выбрасывает нулевую ссылку. Я посмотрел на Request.Url.Host и ни одна из этих частей не равны нулю, что может быть проблема:Условный стиль с использованием исключения бритвы null null
@{
Layout = "NoNavigationMaster.cshtml";
var brand = Common.GetProductBrand(Request.Url.Host);
if (brand == BrandType.SCT)
{
<style type="text/css">
div.products-filter-overlay-body div.bg-image {
position: absolute;
height: 100%;
width: 100%;
bottom: 0;
top: 0;
left: 0;
right: 0;
background: url([email protected]) no-repeat center center fixed;
background-size: cover;
}
</style>
}
else if(brand == BrandType.BullyDog)
{
<style type="text/css">
div.products-filter-overlay-body div.bg-image {
position: absolute;
height: 100%;
width: 100%;
bottom: 0;
top: 0;
left: 0;
right: 0;
background: url([email protected]) no-repeat center center fixed;
background-size: cover;
}
</style>
}
}
Каков ваш метод 'Common.GetProductBrand()'? –