Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Changes in css file do not apply to the page

Changes in css file do not apply to the page

Scheduled Pinned Locked Moved ASP.NET
csharpcsswpfdesign
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chesnokov Yuriy
    wrote on last edited by
    #1

    There is some Default.css file I linked to my web project. The styles are applied normally and look as they should, but when I add new style to css file or change existing one (.button-css), they only take place in design view, but not when the page is being run. However the styles defined in head section (.button-local) are applied as they should during design and run time.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GenderAge._Default" %>

    Default page
    
    .button-local 
        {
            height:24px;
            margin:0px;
            padding:0px 0px 0px 0px;
            margin:0px 0px 0px 0px;
            font-size:15px;
            font-family:Verdana, Arial, Helvetica, sans-serif;
            color:#FF00FF;
        }
    
    
    
    
    <div>normal button
    </div>
    <div>wierd button
    </div>
    

    Чесноков

    A Y S 3 Replies Last reply
    0
    • C Chesnokov Yuriy

      There is some Default.css file I linked to my web project. The styles are applied normally and look as they should, but when I add new style to css file or change existing one (.button-css), they only take place in design view, but not when the page is being run. However the styles defined in head section (.button-local) are applied as they should during design and run time.

      <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GenderAge._Default" %>

      Default page
      
      .button-local 
          {
              height:24px;
              margin:0px;
              padding:0px 0px 0px 0px;
              margin:0px 0px 0px 0px;
              font-size:15px;
              font-family:Verdana, Arial, Helvetica, sans-serif;
              color:#FF00FF;
          }
      
      
      
      
      <div>normal button
      </div>
      <div>wierd button
      </div>
      

      Чесноков

      A Offline
      A Offline
      Arindam Sinha
      wrote on last edited by
      #2

      Did you check the page by adding .button-local to your Default.css?

      Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

      C 1 Reply Last reply
      0
      • A Arindam Sinha

        Did you check the page by adding .button-local to your Default.css?

        Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

        C Offline
        C Offline
        Chesnokov Yuriy
        wrote on last edited by
        #3

        Yes. The problem turned out to be that the changes are applied and the result is seen in VS design view and if the project gets published and you open the page in IE. But the styles become lost when you run the page from VS.

        Чесноков

        A 1 Reply Last reply
        0
        • C Chesnokov Yuriy

          Yes. The problem turned out to be that the changes are applied and the result is seen in VS design view and if the project gets published and you open the page in IE. But the styles become lost when you run the page from VS.

          Чесноков

          A Offline
          A Offline
          Arindam Sinha
          wrote on last edited by
          #4

          I think it's something related to theme. If you have both theme and CSS then theme wins. Anyway, try two things - 1. Remove the CSS file entry from you ASPX form. Then check if it works or not. 2. Next remove your css file from Theme folder to any other 'css' folder. Then check if it's being applied. Obviously, it would have been better if you work with Theme and skin[^]. Checkout if this helps you at all.:)

          Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

          C 2 Replies Last reply
          0
          • A Arindam Sinha

            I think it's something related to theme. If you have both theme and CSS then theme wins. Anyway, try two things - 1. Remove the CSS file entry from you ASPX form. Then check if it works or not. 2. Next remove your css file from Theme folder to any other 'css' folder. Then check if it's being applied. Obviously, it would have been better if you work with Theme and skin[^]. Checkout if this helps you at all.:)

            Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

            C Offline
            C Offline
            Chesnokov Yuriy
            wrote on last edited by
            #5

            Removing the CSS works. I tried themes instead also.

            <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WierdCss._Default" StylesheetTheme="Default" EnableTheming="True" %>

            e.g. in css file I created body class. it works in design view and VS2008 debugging. but after I add next class entry, it works in design view, but no longer in VS2008 ASP.NET dev server??? I remove the css file, and theme. I attach it again, all the same. It seems it catches the snapshot of the css file once it was attached. And next any changes to it or additions of classes are no longer displayed in ASP.NET dev server. :doh:

            Чесноков

            1 Reply Last reply
            0
            • A Arindam Sinha

              I think it's something related to theme. If you have both theme and CSS then theme wins. Anyway, try two things - 1. Remove the CSS file entry from you ASPX form. Then check if it works or not. 2. Next remove your css file from Theme folder to any other 'css' folder. Then check if it's being applied. Obviously, it would have been better if you work with Theme and skin[^]. Checkout if this helps you at all.:)

              Regards, Arindam Sinha MyBlog - http://arindamsinha.wordpress.com/ Please give your feedback on this answer.

              C Offline
              C Offline
              Chesnokov Yuriy
              wrote on last edited by
              #6

              I need to provide CSS rules for html elements e.g. body and for ASP.NET controls. Can I do it using themes only? It needs CSS to be created and attached also

              Чесноков

              1 Reply Last reply
              0
              • C Chesnokov Yuriy

                There is some Default.css file I linked to my web project. The styles are applied normally and look as they should, but when I add new style to css file or change existing one (.button-css), they only take place in design view, but not when the page is being run. However the styles defined in head section (.button-local) are applied as they should during design and run time.

                <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GenderAge._Default" %>

                Default page
                
                .button-local 
                    {
                        height:24px;
                        margin:0px;
                        padding:0px 0px 0px 0px;
                        margin:0px 0px 0px 0px;
                        font-size:15px;
                        font-family:Verdana, Arial, Helvetica, sans-serif;
                        color:#FF00FF;
                    }
                
                
                
                
                <div>normal button
                </div>
                <div>wierd button
                </div>
                

                Чесноков

                Y Offline
                Y Offline
                Yajjoj
                wrote on last edited by
                #7

                may i see the cod of Default.css may be i can find solution for this one.

                al hajjaj

                C 1 Reply Last reply
                0
                • Y Yajjoj

                  may i see the cod of Default.css may be i can find solution for this one.

                  al hajjaj

                  C Offline
                  C Offline
                  Chesnokov Yuriy
                  wrote on last edited by
                  #8

                  http://download.microsoft.com/download/c/7/a/c7a07f0e-4778-4d73-a163-f873a06b18ed/rounded06.msi[^] I add the css and its Images into the App_Theme\Blue theme. I enable themes and set for content page of the master the Blue theme. I attach the css in the <head> of the master. All works great, until at some step during the page developing and asp controls additions, changes in css and styles asignments to asp controls stop to be displayed in ASP.NET development server. Only the publiched version works.

                  Чесноков

                  1 Reply Last reply
                  0
                  • C Chesnokov Yuriy

                    There is some Default.css file I linked to my web project. The styles are applied normally and look as they should, but when I add new style to css file or change existing one (.button-css), they only take place in design view, but not when the page is being run. However the styles defined in head section (.button-local) are applied as they should during design and run time.

                    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GenderAge._Default" %>

                    Default page
                    
                    .button-local 
                        {
                            height:24px;
                            margin:0px;
                            padding:0px 0px 0px 0px;
                            margin:0px 0px 0px 0px;
                            font-size:15px;
                            font-family:Verdana, Arial, Helvetica, sans-serif;
                            color:#FF00FF;
                        }
                    
                    
                    
                    
                    <div>normal button
                    </div>
                    <div>wierd button
                    </div>
                    

                    Чесноков

                    S Offline
                    S Offline
                    sashidhar
                    wrote on last edited by
                    #9

                    They are Some Cases When The Browser store the cookies and the if u add the new styles also, the browser will show the old files .First Delete the cookies and the storage info in the browser I think U know How to delete the cookies privacy data and all .And now check . If this Is not Your Answer Sorry..!If this is Your Answer Let Me know

                    C 1 Reply Last reply
                    0
                    • S sashidhar

                      They are Some Cases When The Browser store the cookies and the if u add the new styles also, the browser will show the old files .First Delete the cookies and the storage info in the browser I think U know How to delete the cookies privacy data and all .And now check . If this Is not Your Answer Sorry..!If this is Your Answer Let Me know

                      C Offline
                      C Offline
                      Chesnokov Yuriy
                      wrote on last edited by
                      #10

                      Yes, that helped. I deleted them from IE after I launched the ASP.NET server and refreshed the page. Great, you saved my troubles!!! :thumbsup: I starting digging deeper e.g. http://www.codeproject.com/Messages/3178921/Re-CSS-styles-cease-to-be-visible-in-ASP-NET-devel.aspx[^] It helped after I added 2 href CSS links to master, the blue and red for 2 themes. Blue css started to work, but only if red link is also present. :omg: and that is my case also: http://forums.asp.net/t/1385824.aspx[^] but their solution does not help

                      Чесноков

                      S 1 Reply Last reply
                      0
                      • C Chesnokov Yuriy

                        Yes, that helped. I deleted them from IE after I launched the ASP.NET server and refreshed the page. Great, you saved my troubles!!! :thumbsup: I starting digging deeper e.g. http://www.codeproject.com/Messages/3178921/Re-CSS-styles-cease-to-be-visible-in-ASP-NET-devel.aspx[^] It helped after I added 2 href CSS links to master, the blue and red for 2 themes. Blue css started to work, but only if red link is also present. :omg: and that is my case also: http://forums.asp.net/t/1385824.aspx[^] but their solution does not help

                        Чесноков

                        S Offline
                        S Offline
                        sashidhar
                        wrote on last edited by
                        #11

                        Good To Hear That ..!

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups