473,320 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to get values from custom config section?

Given this custom config section:
<HttpResourceHandlerSettings compressionOn="true" daysInCache="30">
<fileSets>
<add name="FileSet_CSS_Style1"
value="~/styles/rdstyles.css,~/styles/thickbox.css" />
<add name="FileSet_AdminCSS_Style1"
value="~/styles/rdstyles.css,~/styles/StyleSheet.css" />
<add name="FileSet_JS_Functionality1"
value="~/scripts/jquery.js,~/scripts/thickbox.js" />
</fileSets>
</HttpResourceHandlerSettings>

I want to retrieve the value for a given name i.e.something like the
following pseudocode:
settings.FileSets.Name("FileSet_" & fileSet).value where fileSet is a
querystring value -
Dim fileSet As String = Context.Request.QueryString("fileSet") and a sample
link tag -
<link type="text/css"
href="resourcehandler.aspx?fileSet=CSS_Style1&type =text/css"
rel="Stylesheet"/>

All this is to be functionally equiv to
ConfigurationManager.AppSettings(("FileSet_" + fileSet))

This possible?

Ashok Padmanabhan DVM
Thank you...

Sep 25 '07 #1
1 1481
When you have a custom config section, you have to write the "Handler" for
it.

While not related to your issue/type of data, you can see one here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

Look at the EmailSmtpSettingsHandler code (from the download).


"Showjumper" <nlsdkfjawrote in message
news:uV**************@TK2MSFTNGP03.phx.gbl...
Given this custom config section:
<HttpResourceHandlerSettings compressionOn="true" daysInCache="30">
<fileSets>
<add name="FileSet_CSS_Style1"
value="~/styles/rdstyles.css,~/styles/thickbox.css" />
<add name="FileSet_AdminCSS_Style1"
value="~/styles/rdstyles.css,~/styles/StyleSheet.css" />
<add name="FileSet_JS_Functionality1"
value="~/scripts/jquery.js,~/scripts/thickbox.js" />
</fileSets>
</HttpResourceHandlerSettings>

I want to retrieve the value for a given name i.e.something like the
following pseudocode:
settings.FileSets.Name("FileSet_" & fileSet).value where fileSet is a
querystring value -
Dim fileSet As String = Context.Request.QueryString("fileSet") and a
sample link tag -
<link type="text/css"
href="resourcehandler.aspx?fileSet=CSS_Style1&type =text/css"
rel="Stylesheet"/>

All this is to be functionally equiv to
ConfigurationManager.AppSettings(("FileSet_" + fileSet))

This possible?

Ashok Padmanabhan DVM
Thank you...


Sep 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Patrick | last post by:
Hi I want tu use an app.config like the example below. The problem is, that i don't know how many Action-Tags there will be, because this can be changed by the user. When using...
0
by: Søren Lund | last post by:
Hello, I have implemented a custom config section handler by implementing the IConfigurationSectionHandler interface. I have registered this handler in web.config and everything works fine ......
10
by: Brett | last post by:
If I have many hard coded values such as file paths, file names, timeouts, etc, where is the best place to define them? Meaning, in the case something needs changing for example, rather than...
2
by: Laurent Bugnion | last post by:
Hi, I like to develop custom controls for a number of webpages. These controls are often customizable, so that they can be reused in a number of situations. My question is: What is the best...
6
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I...
6
by: Aneesh P | last post by:
Hi All, I need to encrypt some fields esp password key values in configuration file while installting the application using .Net installer project and decrypt those values from my...
7
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
2
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application =...
0
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I have a web.config custom configuration section using asp.net 2.0 configuration APIs. My custom configuration section inherits from System.Configuration.ConfigurationSection. I have a IIS root...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.