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,

Alok UniyalRank #8,369 · 223 reputationPosted May 31, 2013, 1:55 AM EDT
How u link css file to your page? May be there is some path error.
Vivek A S27 reputationPosted May 31, 2013, 1:57 AM EDT
Let me know the IIS version?
Thanks & Regards
Vivek A S
Kavi sujaRank #6,237 · 272 reputationPosted May 31, 2013, 2:06 AM EDT
Kavi sujaRank #6,237 · 272 reputationPosted May 31, 2013, 2:07 AM EDT
using tags.But I give the correct path only.The CSS files and .aspx files are in seperate folders.
Vivek A S27 reputationPosted May 31, 2013, 2:11 AM EDT
while running the application its working fine?
Kavi sujaRank #6,237 · 272 reputationPosted May 31, 2013, 2:15 AM EDT
Alok UniyalRank #8,369 · 223 reputationPosted May 31, 2013, 2:16 AM EDT
Please may you provide the code for linking? i.e
Kavi sujaRank #6,237 · 272 reputationPosted May 31, 2013, 2:24 AM EDT
I use this link
<link rel="stylesheet" type="text/css" href="../Content/Site.css"
Alok UniyalRank #8,369 · 223 reputationPosted May 31, 2013, 2:26 AM EDT
<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 ../
Vivek A S27 reputationPosted May 31, 2013, 2:26 AM EDT
can u check if the css file is loaded or not in ur browser.
Kavi sujaRank #6,237 · 272 reputationPosted May 31, 2013, 8:52 PM EDT
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...
Ravi ShekharRank #673 · 3.6K reputationPosted Jun 3, 2013, 3:52 AM EDT
" rel="stylesheet" type="text/css" />
this will help you definitely.
regards,
Ravi
Iftikar HussainRank #423 · 5.9K reputationPosted Jun 25, 2013, 7:58 PM EDT
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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts