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

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default 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


    Griff Guest

  2. Similar Questions and Discussions

    1. config file
      Hi, I have a project that I need to write and in the past I would hard code a lot of information in pages that I should have put into a config...
    2. BUG: Server.Execute ignores web.config <location> role permissions
      I have an intranet site that uses authentication mode="Windows" with identity impersonate="true". I recently implemented a site search feature that...
    3. Error loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config
      I had many ASP.NET web applications that I created before I had to rebuild my machine. After a fresh install of XP Pro, VS.NET 2003, etc, I now...
    4. config file: a) what Module ? b) conditionals in config (for multiple hosts)
      Hi, a) I am looking for a module to handle config files. There are a number of these modules, like AppCconig. Any consensus about The Right...
    5. [PHP] config file
      Payne said the following on 9/19/2003 11:23 AM>> take a look at parse_ini() function
  3. #2

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

    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:
    [url]http://openmymind.net/index.aspx?documentId=5[/url]

    you can still use this approach, but it's stupidly easier in 2.0:
    [url]http://msdn2.microsoft.com/en-us/library/system.configuration.configurationsection.aspx[/url]

    and the countless of hits google will give you..

    Karl

    --
    [url]http://www.openmymind.net/[/url]
    [url]http://www.codebetter.com/[/url]


    "Griff" <howling@the.moon> wrote in message
    news:evyOslU4GHA.1496@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
    >

    Karl Seguin [MVP] Guest

  4. #3

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

    Excellent - thanks!


    Griff Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139