i am losing all my styles .. help
-
Hi, my problem is this: In this cms that i have created, the administrator has an admin zone where he/she can alter setting for the given homepage. One function that i am working on is the ability to make the site eather public or private to the public. It is meant to be used before publishing the site to the public, so that the administrator can create all the content for the website and then afterwards make it public for any interested viewers. I alter the web.config bye code, inserting and deleting and respectively. The bug i get is than every second time i do so, i lose all css styles in the administration! my question to you is: How can this be?? -- Christian
-
Hi, my problem is this: In this cms that i have created, the administrator has an admin zone where he/she can alter setting for the given homepage. One function that i am working on is the ability to make the site eather public or private to the public. It is meant to be used before publishing the site to the public, so that the administrator can create all the content for the website and then afterwards make it public for any interested viewers. I alter the web.config bye code, inserting and deleting and respectively. The bug i get is than every second time i do so, i lose all css styles in the administration! my question to you is: How can this be?? -- Christian
Kleindahl wrote:
I alter the web.config bye code, inserting and deleting
Are you altering web.config at runtime ? Altering web.config at runtime will restart the application domain. That might be making problem. For doing such things, it's better to have one separate XML configuration file.
Kleindahl wrote:
The bug i get is than every second time i do so, i lose all css styles in the administration!
Well, provided scenario don't have any relation with styles. How you are referring the style sheets ?
-
Hi, my problem is this: In this cms that i have created, the administrator has an admin zone where he/she can alter setting for the given homepage. One function that i am working on is the ability to make the site eather public or private to the public. It is meant to be used before publishing the site to the public, so that the administrator can create all the content for the website and then afterwards make it public for any interested viewers. I alter the web.config bye code, inserting and deleting and respectively. The bug i get is than every second time i do so, i lose all css styles in the administration! my question to you is: How can this be?? -- Christian
Try to use XML instead of altering the web.config file at runtime. And check whether your stlyesheets coding are closed while executing the application or building the application.
SSK. Anyone who says sunshine brings happiness has never danced in the rain.
-
Kleindahl wrote:
I alter the web.config bye code, inserting and deleting
Are you altering web.config at runtime ? Altering web.config at runtime will restart the application domain. That might be making problem. For doing such things, it's better to have one separate XML configuration file.
Kleindahl wrote:
The bug i get is than every second time i do so, i lose all css styles in the administration!
Well, provided scenario don't have any relation with styles. How you are referring the style sheets ?
hi Navaneeth, first of, thank you for trying to help me out. I know that altering the web.config file will reset the application, but i figured that in this scenario where an administrator would most likely use it to make the site public the first time, it would not madder because outside users whould not be able to see the site yet, and therefore not be logged in. having one separate XML configuration file By this do you mean one more web.config file or just an simpler xml file that i use as a config file To how i refer to the stylesheets: I use themes so i have my admin styles in a theme folder and reference it in my default side (i am using masterpages) hoping that you can help me out :) -- Christian
-
Try to use XML instead of altering the web.config file at runtime. And check whether your stlyesheets coding are closed while executing the application or building the application.
SSK. Anyone who says sunshine brings happiness has never danced in the rain.
hi, thank you for trying to help out. to the And check whether your stylesheets coding are closed while executing the application or building the application. i don't see how it should be possible for the styles to change in any way doing execution of the application? Or by closed did you mean something else? Like finished loading? -- Christian
-
hi Navaneeth, first of, thank you for trying to help me out. I know that altering the web.config file will reset the application, but i figured that in this scenario where an administrator would most likely use it to make the site public the first time, it would not madder because outside users whould not be able to see the site yet, and therefore not be logged in. having one separate XML configuration file By this do you mean one more web.config file or just an simpler xml file that i use as a config file To how i refer to the stylesheets: I use themes so i have my admin styles in a theme folder and reference it in my default side (i am using masterpages) hoping that you can help me out :) -- Christian
Kleindahl wrote:
By this do you mean one more web.config file or just an simpler xml file that i use as a config file
I mean a separate XML file, and keep the settings needed for site in this
Kleindahl wrote:
I use themes so i have my admin styles in a theme folder and reference it in my default side (i am using masterpages)
Sorry, I don't have much idea on using themes. Try changing the settings to other XML file and stop updating web.config at runtime. That may solve the issue. Not sure :~
-
Kleindahl wrote:
By this do you mean one more web.config file or just an simpler xml file that i use as a config file
I mean a separate XML file, and keep the settings needed for site in this
Kleindahl wrote:
I use themes so i have my admin styles in a theme folder and reference it in my default side (i am using masterpages)
Sorry, I don't have much idea on using themes. Try changing the settings to other XML file and stop updating web.config at runtime. That may solve the issue. Not sure :~
N a v a n e e t h wrote:
I mean a separate XML file
Okay, i am gonna try it out as soon as i have the time. Thank you very much for trying to help me out. But one thing that i do not understand is this: if updating the config file doing runtime is so bad ( i have hearded it many times asking questions that i should not do so ), why does microsoft ship the framework with classes for making speciel config sections for programmers to use? I thought that one smart thing would be that we programmers could store app settings and change then when needed? -- Christian
-
N a v a n e e t h wrote:
I mean a separate XML file
Okay, i am gonna try it out as soon as i have the time. Thank you very much for trying to help me out. But one thing that i do not understand is this: if updating the config file doing runtime is so bad ( i have hearded it many times asking questions that i should not do so ), why does microsoft ship the framework with classes for making speciel config sections for programmers to use? I thought that one smart thing would be that we programmers could store app settings and change then when needed? -- Christian
Kleindahl wrote:
why does microsoft ship the framework with classes for making speciel config sections for programmers to use?
Configuration section varies for each project or for each programmer. I will be following one method and you will be following the other. So it's tough to make a common config file. But .NET framework ships with powerful XML manipulation classes. You can make use of those and manipulate with custom settings file. .NET allows us to write a XML serializable class. So using this a XML file can easily be read. Security will be a main issue when you use custom XML configuration files, because it can be accessible via URL. So either you have to use .config extension or add the XML extension to
HttpForbiddenHandler
to secure it. Hope this helps
-
Kleindahl wrote:
why does microsoft ship the framework with classes for making speciel config sections for programmers to use?
Configuration section varies for each project or for each programmer. I will be following one method and you will be following the other. So it's tough to make a common config file. But .NET framework ships with powerful XML manipulation classes. You can make use of those and manipulate with custom settings file. .NET allows us to write a XML serializable class. So using this a XML file can easily be read. Security will be a main issue when you use custom XML configuration files, because it can be accessible via URL. So either you have to use .config extension or add the XML extension to
HttpForbiddenHandler
to secure it. Hope this helps