Solved

StyleSheet not working in ASP.NET 4.0 and IIS7

Posted on 2011-02-27
7
3,899 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

791 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