Page is rendering properly in IDE but not when it's run on the browser RRS feed

  • Question

  • User2103134756 posted

    I'm using the template that comes with VS2010. I'm creating a form based on the master page. I'm using the template CSS for the master page stuff and a few minor items on the form but I have a separate file for the controls. For some reason, the form looks fine in the IDE but when I run the page. I've tried moving the link for the CSS file from the master to the form file but it doesn't work. Tried rebuilding the solution and it doesn't work. Looked at the source from the browser and the reference to the CSS file is getting in but it's as if it's just not applying the rules to the page. The Microsoft CSS is working. This doesn't make sense.

    Tuesday, June 4, 2019 9:23 PM

All replies

  • User409696431 posted

     "Looked at the source from the browser and the reference to the CSS file is getting in but it's as if it's just not applying the rules to the page."

    Is the link to the CSS file correct?  Is the browser using a cached copy of the CSS?

    If you inspect elements on the page in the browser, what CSS is shown as being applied to them?

    Are there any errors in the CSS file shown in the browser tools that cause the browser to stop processing it?

    The only way someone else can really answer this for you is if you publish the page and CSS files and give us a link to it, and tell us what styles you expect to see that are not being applied.

    Tuesday, June 4, 2019 10:18 PM
  • User288213138 posted

    Hi oneillj,

    You can debug through F12 to find out where to render the problem.

    There is a link here you can use F12 Developer Toolbar by reading it. https://www.c-sharpcorner.com/UploadFile/francissvk/f12-developer-toolbar-good-rescuer/

    You can easily navigate the particular DOM elements by clicking on it on the Brower so that you can easily spot the respective "piece of markup" for that element in the whole page. This facilitates easily fixing the issues related to design.

    And please check if there is a problem with your external stylesheet reference.

    Here are the steps to how to reference css:

    1.Right Click on your website/wepapplication in solution explorer.
    2.Click on Add->New Item, Select "Style Sheet" Now a css file is added to your solution.
    3.Write your CSS in this "StyleSheet.css" and Save.
    4.Include the StyleSheet.css file in your aspx page inside tag.

    <head runat="server">
        <link rel="stylesheet" type="text/css" href="StyleSheet.css" />

    If you haven't solved your problem yet, please post your code.

    Best Regard,

    Wednesday, June 5, 2019 7:39 AM
  • User2103134756 posted

    Don't even ask me what happened but as soon as I ran the page today, it worked.  Wondering if there was a cached version of the page that was loading instead of the one that was saved. I closed VS2010 a couple of times before then as well as rebuilt the solution but I'll be. Seems OK now. Thanks for the help, everyone.

    Wednesday, June 5, 2019 8:57 PM