error in web.config
<p>i am using constant contact database for fetching email address and sending news letters to thos addresses.
In my project the admin can change the APIKey,username,password from the form which are dynamically set in web.config and database.
And according to web.config settings the database of constant contact is set and email address for that APIKey,Username,password is get retrived
on local machine it is working,but when i upload it on server it is giving error
"Access to the path 'D:\inetpub\wwwroot\maxnetecommerce\web.config' is denied."</p>

<p>i have to change any web.config settings?</p>

<p>i used the function for updaing web.config is:</p>

<pre><code> public void UpdateConfigKey(string strKey, string newValue)
        {
            Configuration objConfig = WebConfigurationManager.OpenWebConfiguration("~");
            AppSettingsSection objAppsettings = (AppSettingsSection)objConfig.GetSection("appSettings");
            if (objAppsettings != null)
            {
                objAppsettings.Settings[strKey].Value = newValue;
                objConfig.Save();

            }

        }
</code></pre>

<p>my web.config

  
    
      
        
        
          
          
          
          
        
      
    
  </p>

<p></p>

<pre><code>&lt;!--&lt;connecting to server settings,sorry i cant disclose this.&gt;--&gt;



&lt;add key="mailtoread" value="fromtextfile" /&gt;
&lt;add key="FCKeditor:BasePath" value="~/fckeditor/" /&gt;
&lt;add key="FCKeditor:UserFilesPath" value="UserFiles/" /&gt;
&lt;add key="LoginNo" value="x_Login=2A9zZb349" /&gt;
</code></pre>

<p>
    
    </p>

<p></p>

<p>
    
      
        </p>

<pre><code>  &lt;/smtp&gt;
&lt;/mailSettings&gt;
</code></pre>

<p></p>

<p></p>

<p></p>

<pre><code>&lt;compilation debug="true"&gt;
  &lt;assemblies&gt;
    &lt;add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
    &lt;add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;
    &lt;add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
    &lt;add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;

    &lt;add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt;
    &lt;add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
    &lt;add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;

            &lt;add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
            &lt;add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;&lt;/assemblies&gt;
&lt;/compilation&gt;

&lt;authentication mode="Windows"/&gt;
&lt;siteMap enabled="true" defaultProvider="SiteMapDataProvider"&gt;
  &lt;providers&gt;
    &lt;add name="SiteMapDataProvider" type="DBlock.SiteMapDataProvider, DBlock.SiteMapDataProvider"/&gt;
  &lt;/providers&gt;
&lt;/siteMap&gt;
       &lt;customErrors mode="On" defaultRedirect="GenericErrorPage.htm"&gt;
        &lt;error statusCode="403" redirect="NoAccess.htm" /&gt;
        &lt;error statusCode="404" redirect="FileNotFound.htm" /&gt;
    &lt;/customErrors&gt;

&lt;pages&gt;
  &lt;controls&gt;
    &lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
    &lt;add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
  &lt;/controls&gt;
&lt;/pages&gt;
&lt;httpHandlers&gt;
  &lt;remove verb="*" path="*.asmx"/&gt;
  &lt;add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
  &lt;add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
  &lt;add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/&gt;
&lt;/httpHandlers&gt;
&lt;httpModules&gt;
  &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
&lt;/httpModules&gt;
</code></pre>

<p>
  
    
      
        
        
      
    
  
    
    
    
      
      
    
    
      
      
      
      
      
      
      
    
  
  
    
      
        
        
      
      
        
        
      
    
  
</p>
