We can add our custom tags in web config. I got solution from internet with below example. Please check below:
<configuration>
<configSections>
<sectionGroup name="Test">
<section name="pageStyle" type="Xpode.MyName, MyStyle" />
</sectionGroup>
</configSections>
<devhood>
<pageStyle backColour="navy" />
</devhood>
</configuration>
namespace Xpode
{
internal class MyName : IConfigurationSectionHandler
{
public virtual object Create(Object parent, Object context, XmlNode node)
{
MyStyle config = new MyStyle((PageStyle)parent);
config.LoadValuesFromConfigurationXml(node);
return config;
}
}
public class MyStyle
{
string _backColour;
internal MyStyle(PageStyle parent)
{
if (parent != null)
_backColour = parent._backColour;
}
internal void LoadValuesFromConfigurationXml(XmlNode node)
{
XmlAttributeCollection attribCol = node.Attributes;
_backColour = attribCol["backColour"].Value;
}
public string BackColour
{
get
{
return _backColour;
}
}
}
}