Create Web.Config group

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

Is it possible to create a custom Web.Config group?
I am creating various classes that need some parameters to be defined
by the user that uses these classes.

So i was thinking about placing that information on Web.Config.

Thanks,
Miguel
 
Miguel-

Yeah, if you're using .NET 2.0 or higher, they're called config sections.

Scott wrote up a good article at http://aspnet.4guysfromrolla.com/articles/032807-1.aspx.

HTH.

-dl

--
David R. Longnecker
http://blog.tiredstudent.com

s> Hello,
s>
s> Is it possible to create a custom Web.Config group?
s> I am creating various classes that need some parameters to be defined
s> by the user that uses these classes.
s> So i was thinking about placing that information on Web.Config.
s>
s> Thanks,
s> Miguel
 
Yes, this is done quite regularly with controls added to sites. Consider,
for example, the AJAX bits in ASP.NET. Here is one example (probably not the
best, but it is one):

http://support.microsoft.com/kb/309045/

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
 
<configuration>
<configSections>
<sectionGroup name="NewSectionGroup">
<section name="NewSection"
type="System.Configuration.NameValueSectionHandler,System" />
</sectionGroup>
</configSections>
<NewSectionGroup>
<NewSection>
<add key="key1" value="value1" /> <add key="key2" value="value2" />
</NewSection>
</NewSectionGroup>
</configuration>



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top