private void UpdateField(HttpContext context) { if (this.SelectedTaxonomyStrucure == null) { return; } ProjectHierarchy taxonomyStructure = new ProjectHierarchy(this.SelectedTaxonomyStrucure); // Parse the xPath of the field's xml node to // get from the http request's parameters. string xPath = context.Request.Params["XPath"]; // Select the field's xml node. XmlNode xmlNode = taxonomyStructure.XmlDocument.SelectSingleNode(xPath); // Check if the field exists. if (xmlNode == null) { return; } ProjectHierarchyField field = new ProjectHierarchyField(taxonomyStructure, xmlNode); Panel pnlField = field.Render(this.IdLanguage); // Write the field's panel as html to the http response. context.Response.Write(pnlField.ToHtml()); // Set the http response's content type to plain text. context.Response.ContentType = "text/plain"; }
private void GetFields(HttpContext context) { if (this.SelectedTaxonomyStrucure == null) { return; } ProjectHierarchy taxonomyStructure = new ProjectHierarchy(this.SelectedTaxonomyStrucure); string xPath = context.Request.Params["XPath"]; XmlNode xmlNode = taxonomyStructure.XmlDocument.SelectSingleNode(xPath); if (xmlNode == null) { return; } StringBuilder result = new StringBuilder(); // Run through all field xml nodes of the xml node. foreach (XmlNode xmlNodeField in xmlNode.SelectNodes("Field")) { ProjectHierarchyField field = new ProjectHierarchyField(taxonomyStructure, xmlNodeField); Panel pnlField = field.Render(this.IdLanguage); result.Append(pnlField.ToHtml()); result.Append("<br />"); } context.Response.Write(result.ToString()); // Set the http response's content type to plain text. context.Response.ContentType = "text/plain"; }