Dear All,
Hi, I want add some comments in my web.config file at runtime.
Means for example
original Web.config file is:
<pre lang="xml"><?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="customsetting1" value="Some text here" />
<add key="myKey" value=",1,1,1,1,1,1" />
<add key="RemoveTCPError" value="1,1" />
</appSettings>
<connectionStrings>
<add name="myDatabaseName" connectionString="whatever" />
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
</system.web>
</configuration>
On some Button click,after it modified like :
="1.0"
<configuration>
<appSettings>
<add key="customsetting1" value="Some text here" />
<add key="myKey" value=",1,1,1,1,1,1" />
<add key="RemoveTCPError" value="1,1" />
</appSettings>
<connectionStrings>
<add name="myDatabaseName" connectionString="whatever" />
</connectionStrings>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
</system.web>
</configuration>
or any where in the web.config file commnets should be added or in any commented part text should be added.
Is this possible.
Please,Help me.
Thanks to all in Advance.
Regards,
Ranjeet Waje