Solved

StyleSheet not working in ASP.NET 4.0 and IIS7

Posted on 2011-02-27
7
3,785 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
Comment Utility
0
 

Author Comment

by:Atif-XiChi
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:Atif-XiChi
Comment Utility
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
Comment Utility
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
Comment Utility

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
Comment Utility
the reason is that I did the research and hard work to find the solution.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

771 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

12 Experts available now in Live!

Get 1:1 Help Now