Click here to Skip to main content
16,018,442 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm facing a problem when our application is deployed in IIS. The styles are not applying to the content page but everything was working fine when I was running it through VS 2010. This is what I have given in the master page.

C#
<link href="Styles/style.css" rel="stylesheet" type="text/css" />

The above code which I have specified will apply only for the Home page which is in the root directory but when I navigate to so other module styles are not applying to those page which are inside other folder.

I searched in Google and I tried many options like
C#
<link href="./Styles/style.css" rel="stylesheet" type="text/css" />
<link href="../Styles/style.css" rel="stylesheet" type="text/css" />
<link href="~/Styles/style.css" rel="stylesheet" type="text/css" />
<link href="/Styles/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
    @import 'Styles/style.css'; </style>

None of the above things are working even for home page also which used to work before. Please let me know some suggestions so I can proceed further.
Posted
Updated 22-Dec-13 20:07pm
v2

1 solution

Give your style's reference after title in your Master Page.
Like :

<title></title>
Then All content page of this master page can access styles.
 
Share this answer
 
Comments
Nuthan Gowda 23-Dec-13 1:54am    
Yes. I have given right after the <title></title>
Sujee1 23-Dec-13 1:56am    
Then what happend ?
Nuthan Gowda 23-Dec-13 1:58am    
not now. from the start It is there only and it is not working.
Sujee1 23-Dec-13 2:02am    
Give same reference in your content also
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<link href="Styles/style.css" rel="stylesheet" type="text/css" />




Try this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900