storing values web.config - appsettings configsection - some-more efficient?
i'm minute page integrate opposite themes, i'm going store information any thesis web.config.
is some-more fit emanate new sectiongroup store all together, only put all appsettings?
configsection solution
<configsections>
<sectiongroup name="schedulerpage">
<section name="providers" type="system.configuration.namevaluesectionhandler"/>
<section name="themes" type="system.configuration.namevaluesectionhandler"/>
</sectiongroup>
</configsections>
<schedulerpage>
<themes>
<add key="pi" value="pischedulerform"/>
<add key="ub" value="ubschedulerform"/>
</themes>
</schedulerpage>
to opening values configsection, i am controlling code:
namevaluecollection themes = configurationmanager.getsection("schedulerpage/themes") namevaluecollection;
twine schedulertheme = themes["ub"];
appsettings solution
<appsettings>
<add key="pitheme" value="pischedulerform"/>
<add key="ubtheme" value="ubschedulerform"/>
</appsettings>
to opening values appsettings, i am controlling code
twine schedulertheme = configurationmanager.appsettings["ubschedulerform"].tostring();
Comments
Post a Comment