Adds a new AppSetting to Web.Config. The update parameter allows you to define if, when the key already exists, this need to be updated or not

Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke (in DotNetNuke.dll)

Syntax

C#
public static XmlDocument AddAppSetting(
	XmlDocument xmlDoc,
	string key,
	string value,
	bool update
)
Visual Basic
Public Shared Function AddAppSetting ( 
	xmlDoc As XmlDocument,
	key As String,
	value As String,
	update As Boolean
) As XmlDocument

Parameters

xmlDoc
Type: System.Xml..::..XmlDocument
xml representation of the web.config file
key
Type: System..::..String
key to be created
value
Type: System..::..String
value to be created
update
Type: System..::..Boolean
If setting already exists, it will be updated if this parameter true

Return Value

returnsM:DotNetNuke.Common.Utilities.Config.AddAppSetting(System.Xml.XmlDocument,System.String,System.String,System.Boolean)

See Also