Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 2nd, 2007, 05:55 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default in web.config or ConfigSection.cs?

in the book, we have some settings stored in the <theBeerHouse> of web.config and some in the TheBeerHouseSection class of ConfigSection.cs and some both(defaultConnectionStringName). is there a logic or rule to determine what goes to what? i can't just copy from the book without knowing why. if you figure this out, can you help me here? thanks!!

  #2 (permalink)  
Old February 3rd, 2007, 03:59 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

or if anyone can point me to from where i can get help on this issue? that'd be much appreciated.

  #3 (permalink)  
Old February 3rd, 2007, 04:39 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

We created our own application settings and placed them in TheBeerHouse section of web.config. The ConfigSection.cs provides us with a configuration tier to get at the application settings. There is really nothing mysterious about it. Each configuration level within web.config has a corresponding class in ConfigSection.cs that defines what is to be found and any default values. The top-level item is TheBeerHouse section which is defined when we inherit from ConfigurationSection. Notice that there are two properties that are not defined as elements (defaultConnectionStringName and defaultCacheDuration). Those properties have default values assigned so that if they are not defined in web.config those values are used. As it happens, defaultConnectionStringName is defined and defaultCacheDuration is not. We could override the defaultCacheDuration in this way:
<TheBeerHouse defaultConnectionStringName="LocalSqlServer" defaultCacheDuration=250 >

Each of the elements is defined as required, meaning that they are expected within TheBeerHouse configuration and each class which defines the element is inherited from ConfigurationElement. An element can also have properties and, in fact, they all do. Remember that each of the other tiered providers, etc. will use these configuration elements.

I hope that I have shed a little light on the subject.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.config dpkbahuguna ASP.NET 3.5 Basics 2 August 26th, 2008 09:41 AM
web.config vs. app.config darlo Visual Studio 2005 11 August 20th, 2008 07:23 AM
Web Config SteveP55419 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 January 3rd, 2007 04:19 PM
web.config nagsumam .NET Framework 1.x 3 November 29th, 2006 10:09 AM
configSection.cs and other bafflements MM BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 November 16th, 2006 06:45 PM



All times are GMT -4. The time now is 04:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.