yes.. I just found out that's one way of doing it... but I checked on a
sample project by ASP.NET Community Stater kit and they config their
application like this..
<configuration>
<configSections>
<sectionGroup name="communityStarterKit">
<section name="Isp"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
<section name="pagePaths"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
<section name="database"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
<section name="services"
type="ASPNET.StarterKit.Communities.CommunitiesSec tionHandler,ASPNET.Starter
Kit.Communities" />
</sectionGroup>
</configSections>
<communityStarterKit>
<Isp>
<add key="IspUsername" value="admin" />
<add key="IspPassword" value="a1854928" />
</Isp>
<pagePaths>
<add key="basePage" value="/communityDefault.aspx" />
<add key="baseService" value="/communityService.asmx" />
</pagePaths>
<database>
<add key="connectionString"
value="server=localhost;uid=sa;pwd=secret;database =communityStarterKitNEW"
/>
</database>
<services>
<add key="enableServiceTimer" value="true" />
</services>
</communityStarterKit>
<system.web>
<compilation debug="false" />
......
I wonder how they come up with that. And notice that they have
<configSections> section above at the start of it. I can't find any info
about that anywhere.
Thanks.
----------------------------------------------------------------------------
---- -----------------------------------------------------------------------
---------
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
You've got to use the correct keywords and syntax. You can't make up your
own hierarchy like that. You'll want something like this:
<appSettings>
<add key="Application1" value="MyApplication1" />
<add key="Setting1" value="MySetting" />
</appSettings>
See the hierarchy here:
http://msdn.microsoft.com/library/de...ionsschema.asp
Ken
"Razak" <ra***@mmsc.com.my> wrote in message
news:Or**************@TK2MSFTNGP12.phx.gbl... Hello, I'm new with ASP.NET.
I've seen samples which has custom 'entry' in Web.Config which works
well. But when I enter my 'entry', it produces app error:
The entry is like below:-
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<myAspApp>
<database>
<add key="connectionString" value="Server=sqlserver; uid=sa;
pwd=1234; database=testDB" />
</database>
</myAspApp>
<system.web>
.
.
.
</system.web>
</configuration>
Why doesn't it work for me whereas the samples implement the same method
for
configuring its app db connection?
Please help. Thanks.
--------------------------------------------------------------------------
--
---- ---------------------------------------------------------------------
--
---------