Results 1 to 14 of 14

Thread: [RESOLVED] Publishing ASP.Net

  1. #1

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    Resolved [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

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    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

  3. #3

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    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!

  4. #4

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    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.

  5. #5
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    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

  6. #6

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    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?

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Publishing ASP.Net

    yolandre,

    If you enter the path to the CSS file directly into the browser, does it open up?

    Gary

  8. #8

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    Re: Publishing ASP.Net

    Hi Gary,
    Nope doesn't.

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  10. #10

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    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.

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  12. #12

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    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.

  13. #13

    Thread Starter
    Addicted Member yolandre's Avatar
    Join Date
    Oct 2004
    Posts
    177

    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!

  14. #14
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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
  •  



Click Here to Expand Forum to Full Width