ralphtrent
Programmer
I have been searching all morning but nothing seems to be what I need to do.
I have a class that will create an Excel workbook. I need to have some settings set at run time; client id etc. etc. etc. I initially wrote this all in an exe but need to not give it a web-presence.
I need to keep the settings in the class, which I have but I need to make the settings exposed to the front end.
I know I can make the settings settable as well as read only and I have done that and I was able to modify the value of the client id in code, but there are some settings, that I would like to change via the web.config file.
I have added this to my web.config. The name of my class is TzRptClientDefectsCls.
I then added this
Do I need to do anything else to be my setting valued? Do I need to explicitly set the value of my ClientId?
Any help is appreciated.
I have a class that will create an Excel workbook. I need to have some settings set at run time; client id etc. etc. etc. I initially wrote this all in an exe but need to not give it a web-presence.
I need to keep the settings in the class, which I have but I need to make the settings exposed to the front end.
I know I can make the settings settable as well as read only and I have done that and I was able to modify the value of the client id in code, but there are some settings, that I would like to change via the web.config file.
I have added this to my web.config. The name of my class is TzRptClientDefectsCls.
Code:
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TzRptClientDefectsCls.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
I then added this
Code:
<appSettings>
<TzRptClientDefectsCls.Settings>
<setting name="ClientId" serializeAs="System.Int32">
<value>666</value>
</setting>
</TzRptClientDefectsCls.Settings>
</appSettings>
Do I need to do anything else to be my setting valued? Do I need to explicitly set the value of my ClientId?
Any help is appreciated.