Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Css is not working properly in asp.net mvc3 Razor Views

I have a application on asp.net mvc3 and working in a razor view. On my layout page I attach a css file and put some css in that file, but when I access /Account/LogOn view the css is not working.
It only works if I attach the css on Logon view. Anyone know why my css attached on the layout page is not working on /Account/LogOn?

I also tried by including following code:

@{
Layout = "~/Views/Shared/_Layout.cshtml";
ViewBag.Title = "xyz.com – Login";
 }

It is still not working. Thanks in advance

like image 567
smart boy Avatar asked Jan 15 '23 08:01

smart boy


1 Answers

Refer your css using url helper like this

<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/default.css")"  media="screen" />
like image 117
amesh Avatar answered Jan 28 '23 16:01

amesh