473,388 Members | 1,493 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,388 software developers and data experts.

Role of the web.config file with UserControls [2.0]

Most of the configuration information for a web application exist in the
web.config file.

We're planning on writing a set of compiled UserControls that could be used
by "any" web site. Of course, we're not going to be aware what information
has already been added to the web site's web.config file, so are a little
apprehensive about relying upon it in case there are any "conflicts". What
should we do...?

Thanks

Griff
Sep 26 '06 #1
2 1139
Use a custom configuration handler. That way in the web.config you can have
your own little section:

<myCompany>
<Web imagePath="images/">
<Cache Timeout="323" Type="Memory" />
...whatever else you need
</Web>
<myCompany>

This way you avoid any potential conflict and can creating a strongly type
configuration class.

This is how you did it in 1.x:
http://openmymind.net/index.aspx?documentId=5

you can still use this approach, but it's stupidly easier in 2.0:
http://msdn2.microsoft.com/en-us/lib...onsection.aspx

and the countless of hits google will give you..

Karl

--
http://www.openmymind.net/
http://www.codebetter.com/
"Griff" <ho*****@the.moonwrote in message
news:ev**************@TK2MSFTNGP05.phx.gbl...
Most of the configuration information for a web application exist in the
web.config file.

We're planning on writing a set of compiled UserControls that could be
used by "any" web site. Of course, we're not going to be aware what
information has already been added to the web site's web.config file, so
are a little apprehensive about relying upon it in case there are any
"conflicts". What should we do...?

Thanks

Griff

Sep 26 '06 #2
Excellent - thanks!
Sep 26 '06 #3

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

Similar topics

4
by: Jeffrey Palermo [MCP] | last post by:
I use web.config files in many directories, and my aspx files can access the AppSettings. If I have a subdirectory Foo with an aspx, and Foo has a local web.config that defines an AppSetting. My...
7
by: david | last post by:
I have the following questions to ask. For example, there are two roles, A and B to grant to users UA and UB respectively. UB in not in role A and UA is not in role B. A can access to Apage and...
3
by: Niyazi | last post by:
Hi, I want to configure the web.config for the Role base Form Authentication. I forget now but I red somewhere that I should use 3 *.config file as: - Manager manager.config -...
7
by: SparkPlug | last post by:
Does anyone know why I might be getting an XmlSchemaException in App.config configured as below to use the UIP Application Block? I get the following error for every element, sub-element and...
12
by: Mesan | last post by:
I have a directory in an app I'm building that has access limited to users within a specific role and all aspx pages in that directory are unavailable just as I'd hope but other files (pdfs and...
5
by: Nathan Sokalski | last post by:
My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE" tagName="Banner" src="~/Banner.ascx"/> <add tagPrefix="NATE"...
5
by: Alias | last post by:
Hi - I'm trying to implement a custom RoleProvider based on the SqlRoleProvider. I keep receiving a an error that it can't load type 'MyRoleTest.MyRoleProvider' when trying to load my...
2
by: Chris | last post by:
Hi, i defined a role ('manager') with one memberuser: Bob. The website has a subdirectory called "allusers" which contains two pages: allusers.aspx and manager.aspx. The page allusers.aspx must...
2
by: =?Utf-8?B?YW5vbg==?= | last post by:
I am not sure if this is the right forum. Environment : Windows server 2008, IIS 7.0 I get the 'Could not load the file or assembly 'blowery.web.httpCompress' or one of its dependencies. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.