Solved

StyleSheet not working in ASP.NET 4.0 and IIS7

Posted on 2011-02-27
7
3,827 Views
Last Modified: 2012-05-11
Hello,

I have a ASP.NET web application in Visual Studio 2010, that I have been working on for the past month using the ASP.NET development server. When I tried to set it up to run under IIS7, it does not work properly: the StyleSheet is not detected and the pages render as without any CSS styles.

I have checked all the paths and <link> tags within the application, and they are correct. I think it has something to do with IIS7 settings which I cant seem to figure out.

A bit of a background: I am running Windows 7 OS with MS SQL Server 2008 R2.
I ran the "aspnet_regiis.exe -i" after installing IIS7 (I installed II7 after installing Visual Studio 2010 on my dev machine). when I tried to use the regsvr32 command to register aspnet_isapi.dll, it gave me an error: "aspnet_isapi.dll was loaded but the entry-point DllRegisterServer was not found." But I think this should not be a problem because, I have another Web Application, "DotNetNuke" setup correctly on my same machine and it runs absolutely fine (no CSS problems). The only thing different between DNN and my Application is that my application is configured as a website under the root "Default Web Site" node in IIS7.

would really appreciate if I could get some help. Thanks in advance.
0
Comment
Question by:Atif-XiChi
  • 5
  • 2
7 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34992987
0
 

Author Comment

by:Atif-XiChi
ID: 34993321
hello jacko72,

My IIS7 Manager does not look like anything which is shown in the blog you posted. It says IIS7 Manager should look like the following:
 install-iis7-02.png

when in fact, my IIS7 Management console look like following on Win7 machine:
 IIS7 Management console on my machine
you can clearly see that the Roles, Features, Diagnostics, Configuration and Storage nodes are just not there in my IIS7 Manager left pane...

Am I missing something? Please help! thanks for your reply
- Atif
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34993401
In Add/Remove Windows Features in control panel, Expand World Wide Web Services, Expand Common HTTP Features, Ensure Static content is checked. I would check everything here. Click OK
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:Atif-XiChi
ID: 34993425
I have done that, and checked everything under IIS in Windows Features On/Off...

but still the same problem. and now one additional problem: when I change my web project properties to make it run under ASP.NET internal development server, it behaves in the same manner as under IIS: No CSS... whereas, before I started out to set up IIS7 it was running fine under internal development server.

appreciate you time. Please help! Thanks
0
 

Author Comment

by:Atif-XiChi
ID: 34993458
hello,

I now think that it is not a problem with IIS7.

I have written a Custom Membership Provider (as a class library) and am using that on my website. I have set up Forms Authentication and when I use the following tag in web.config:

<authorization>
      <deny users="?" />
      <allow users="*" />
</authorization>
   
the login page that I see does not have any CSS.

when I allow anonymous access (by removing  the line <deny users="?" />), I see that all the forms, including the Login page, display correctly (with CSS enabled and styles applied), both on IIS7 as well as the internal development server.

does anyone have any idea what is going on?

Thanks in advance.
- Atif
0
 

Accepted Solution

by:
Atif-XiChi earned 0 total points
ID: 34993555

the issue now resolved. I had set the authorization false on the whole directory; which meant that the CSS file itself was not accessible to unauthorized users. allowing ALL users full access to CSS files (through web.config) solved the issue.

thanks for your time.

Atif
0
 

Author Closing Comment

by:Atif-XiChi
ID: 35034674
the reason is that I did the research and hard work to find the solution.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now