ireland
October 16th, 2006, 11:05 AM
I thought I'd use the Custom Sections in a web.config to store some strings.
I wish to use the web.config to enable the client's admin to edit messages which may appear in the application.
I want development to have the ability to add strings which will be keyed using a string name and accessed from our code base using only the string name as a parameter.
I've tried these custom sections and followed the example at msdn, http://msdn2.microsoft.com/en-us/library/ms228056.aspx, but I don't really see the use of this now because from what I can see if the a developer wishes to add a string to the web.config then they'll be required to edit the handler too, this is no use!
I want the handler to return the string which is keyed using a string, the key passed in is the string name.
Here is the type of format of the config file that I was hoping to use:
<!-- Configuration section settings area. -->
<myCustomGroup>
<myCustomSection Message="Message">
<myChildSection
messagestring1="I'm the first string edit me."
messagestring2="I'm the second string edit me."
messagestring3="I'm the third string edit me."
.......
/>
</myCustomSection>
</myCustomGroup>
I hoped development could simply add a new attribute and value to the myChildSection element and then access it from code using the attribute as a parameter to an accessor function!
I wish to use the web.config to enable the client's admin to edit messages which may appear in the application.
I want development to have the ability to add strings which will be keyed using a string name and accessed from our code base using only the string name as a parameter.
I've tried these custom sections and followed the example at msdn, http://msdn2.microsoft.com/en-us/library/ms228056.aspx, but I don't really see the use of this now because from what I can see if the a developer wishes to add a string to the web.config then they'll be required to edit the handler too, this is no use!
I want the handler to return the string which is keyed using a string, the key passed in is the string name.
Here is the type of format of the config file that I was hoping to use:
<!-- Configuration section settings area. -->
<myCustomGroup>
<myCustomSection Message="Message">
<myChildSection
messagestring1="I'm the first string edit me."
messagestring2="I'm the second string edit me."
messagestring3="I'm the third string edit me."
.......
/>
</myCustomSection>
</myCustomGroup>
I hoped development could simply add a new attribute and value to the myChildSection element and then access it from code using the attribute as a parameter to an accessor function!