예제 #1
0
        public static void SetNotFoundPage(int parentId, int pageNotFoundId)
        {
            var x = ConfigFile.SelectSingleNode(string.Format("//notFoundPage [@parent = '{0}']", parentId.ToString()));

            if (x == null)
            {
                x = ConfigFile.CreateElement("notFoundPage");
                var a = ConfigFile.CreateAttribute("parent");
                a.Value = parentId.ToString();
                x.Attributes.Append(a);
                ConfigFile.DocumentElement.AppendChild(x);
            }

            x.InnerText = pageNotFoundId.ToString();

            ConfigFile.Save(HostingEnvironment.MapPath(PluginFolder + "/" + ConfigFileName));

            HttpRuntime.Cache.Remove("pageNotFoundManagerSettingsFile");
            EnsureConfig();
        }