|
-
Jan 3rd, 2011, 05:46 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Publishing ASP.Net
Hi all,
When running my ASP.Net project in debug mode all appears in perfect order, however after pbulishing the project to Windows Web Server 2008 R2 (IIS7) I get the that the style sheet being referenced by Site.Master is not loaded.
Code:
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
I've confirmed the correct paths and file names on numerous occasions, but to no avail.
Any advice?
Thanks in advance.
Last edited by yolandre; Jan 4th, 2011 at 12:21 AM.
Reason: Resolved
-
Jan 3rd, 2011, 06:13 AM
#2
Re: Publishing ASP.Net
Did you view source of the file. IS it same ?
Please mark you thread resolved using the Thread Tools as shown
-
Jan 3rd, 2011, 06:26 AM
#3
Thread Starter
Addicted Member
Re: Publishing ASP.Net
Dana,
Yes, the code extract comes from the source of the Site.Master file. In that regard I've confirmed the correct location of the stylesheet and the spelling of its name which prooved to be exactly the same accross the board.
I've also considerred other potential solutions such as changing the source to: <link href='~/Styles/Site.css' type='text/css' rel='stylesheet' />,
<link href='../Styles/Site.css' type='text/css' rel='stylesheet' />, and
<link href='/Styles/Site.css' type='text/css' rel='stylesheet' /> - none of which worked.
Thanks for the speedy reply!
-
Jan 3rd, 2011, 06:41 AM
#4
Thread Starter
Addicted Member
Re: Publishing ASP.Net
Something I didn't mention earlier: the default start page is supposed to reflect an image on an image button, which it us not. Again I've confirmed the correct file name and path of the image file, again it appears perfect in debug mode, but live is a different story all together.
Thanks in advance.
Last edited by yolandre; Jan 3rd, 2011 at 07:00 AM.
-
Jan 3rd, 2011, 07:16 AM
#5
Re: Publishing ASP.Net
<link href='../Styles/Site.css' type='text/css' rel='stylesheet' />
This mean that there should a folder called Styles before your rootfolder and inside that CSS. Did you place the css file inside the root file itself and tried in debug and release mode ?
Please mark you thread resolved using the Thread Tools as shown
-
Jan 3rd, 2011, 07:23 AM
#6
Thread Starter
Addicted Member
Re: Publishing ASP.Net
Yes I did. I've done some searches in this regard and it appears that I'm not the only one experiencing this problem. Until I find a workable solution I think best is to simply develop a new page?
-
Jan 3rd, 2011, 07:58 AM
#7
Re: Publishing ASP.Net
yolandre,
If you enter the path to the CSS file directly into the browser, does it open up?
Gary
-
Jan 3rd, 2011, 08:24 AM
#8
Thread Starter
Addicted Member
-
Jan 3rd, 2011, 08:25 AM
#9
Re: Publishing ASP.Net
Hey,
In which case, that means that the CSS file hasn't made it along with the published ASP.Net Application. Are you sure you have included it?
Gary
-
Jan 3rd, 2011, 08:38 AM
#10
Thread Starter
Addicted Member
Re: Publishing ASP.Net
Absolutely yes. It published on the web server and moments ago I double checked the complete path's existance on the web server - all in tact CSS file included. Permissions on the web server possibly?
Last edited by yolandre; Jan 3rd, 2011 at 08:45 AM.
-
Jan 3rd, 2011, 09:17 AM
#11
Re: Publishing ASP.Net
If you have verified the local path to the CSS file on the server, and it is there, then yes, there are only a couple things that could be wrong.
For instance, permissions, as you mentioned, or an incorrectly configured virtual directory. I would work on getting the CSS file to load directly in the browser, that will be the first sign that things are starting to work.
Gary
-
Jan 3rd, 2011, 10:02 AM
#12
Thread Starter
Addicted Member
Re: Publishing ASP.Net
I agree Gary, that's the only logical explanation. Have just re-confirmed the project on the web server and am convinced the problem relates to permissions on the web server.
Planning to apply adjustments now, and should all go according to plan I'll close the thread.
-
Jan 4th, 2011, 12:20 AM
#13
Thread Starter
Addicted Member
Re: Publishing ASP.Net
Gary,
Just to confirm: the problem definitely resides with IIS7 on Windows Web Server 2008. After having my share of fun and games with IIS7 on Windows 7 Ultimate I managed to publish the site on my local host and it tied up with the CSS perfectly.
Thanks for the effort all!
-
Jan 4th, 2011, 03:04 AM
#14
Re: [RESOLVED] Publishing ASP.Net
Hey,
Have you been able to figure out what the problem was then? Or just narrow down the cause of the problem?
When you try and access the css file directly in the browser, what response do you get from the server? A 401? What?
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|