public void SetPageAttribute(string pageId, string attr, string value)
{
try
{
// get the page
XmlDocument doc = GetPageContent(pageId);
XmlNode page = doc.DocumentElement;
if (page == null || page.Attributes == null) return;
if (page.Attributes[attr] == null)
{
XmlAttribute xAttr = doc.CreateAttribute(attr);
xAttr.Value = value;
page.Attributes.Append(xAttr);
}
else
{
page.Attributes[attr].Value = value;
}
// update the page
_mApp.UpdatePageContent(doc.OuterXml);
}
catch (Exception e)
{
throw new ApplicationException("Error in SetPageAttribute: " + e.Message, e);
}
}