I develop a web application in ASP.NET with C#.In debug mode it runs perfectly.The CSS styles are applied correctly.But when i publish the project and host it to IIS,the application runs without CSS styles. That looks an empty environment in designing.I can't understand what's the problem behind this.Whether in IIS version or in links to CSS files,where is the problem i confused about that.Can you tell about these problem guys..
When host to IIS,the styles in CSS can't be applied
Hi,

Iftikar HussainPosted Jun 25, 2013, 11:58 PM
Change your path for css as like below
<link rel="stylesheet" type="text/css" href="~/Content/Site.css" />
The '~' character will point to your root path. i.e. when you browse the css file the path will behttp://localhost/Content/Site.css
Regards,
Iftikar
Remember to click "Mark as Answer" on the post, if it helps you.
Ravi ShekharPosted Jun 3, 2013, 7:52 AM
" rel="stylesheet" type="text/css" />
this will help you definitely.
regards,
Ravi
Kavi sujaPosted Jun 1, 2013, 12:52 AM
Friends,I'm still now in that problem.I change the css link path.However CSS Styles can't be applied.There's any change in IIS I have to do?Help me Guys...
Vivek A SPosted May 31, 2013, 6:26 AM
can u check if the css file is loaded or not in ur browser.
Alok UniyalPosted May 31, 2013, 6:26 AM
<link rel="stylesheet" type="text/css"href="Content/Site.css"
or
<link rel="stylesheet" type="text/css"href="../../Content/Site.css"
or other variations in ../
Kavi sujaPosted May 31, 2013, 6:24 AM
I use this link
<link rel="stylesheet" type="text/css" href="../Content/Site.css"
Alok UniyalPosted May 31, 2013, 6:16 AM
Please may you provide the code for linking? i.e
Kavi sujaPosted May 31, 2013, 6:15 AM
Vivek A SPosted May 31, 2013, 6:11 AM
while running the application its working fine?
Kavi sujaPosted May 31, 2013, 6:07 AM
using tags.But I give the correct path only.The CSS files and .aspx files are in seperate folders.
Kavi sujaPosted May 31, 2013, 6:06 AM
Vivek A SPosted May 31, 2013, 5:57 AM
Let me know the IIS version?
Thanks & Regards
Vivek A S
Alok UniyalPosted May 31, 2013, 5:55 AM
How u link css file to your page? May be there is some path error.