If you use $ delimiters in the AppSetting values these can be replaced with the key values they represent from the AppSettings e.g.
<add key="PrivacyPolicyURL"
value="$domain$/Default.aspx?siteid=$siteid$&locid=$locid$&tpid=$tpid$"
/>
using the following function to do the substitutions;
public static string GetAppSetting(string key)
{
string keyValue = ConfigurationManager.AppSettings[key].ToString();
foreach (System.Text.RegularExpressions.Match match in System.Text.RegularExpressions.Regex.Matches(keyValue, @"\$[\d\D]*?\$"))
{
try
{
string replaceWith = ConfigurationManager.AppSettings[match.Value.Replace("$", string.Empty)] ?? string.Empty;
keyValue = keyValue.Replace(match.Value, replaceWith);
}
catch
{
keyValue = keyValue.Replace(match.Value, string.Empty);
}
}
return keyValue;
}
So in the example this inserts the AppSettings for domain, siteid, locid and tpid to produce something like; www.mywebsite.com/Default.aspx?siteid=1001&locid=1001&tpid=1001