Solved

StyleSheet not working in ASP.NET 4.0 and IIS7

Posted on 2011-02-27
7
3,988 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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