using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Xml; using System.Xml.Xsl; using System.IO; public partial class _Default : System.Web.UI.Page { XmlDocument XDoc = new XmlDocument(); protected void Page_Load(object sender, EventArgs e) { XslCompiledTransform xsl = new XslCompiledTransform(); XsltArgumentList xslarg = new XsltArgumentList(); StringWriter sw = new StringWriter(); StringWriter sw1 = new StringWriter(); Control ctrl = new Control(); string result = ""; XDoc.Load(Server.MapPath("~/Xml/HomePageImageGallery.xml")); xsl.Load(Server.MapPath("~/XSLT/HomePageImageGallery.xslt")); xsl.Transform(XDoc, xslarg, sw); result = sw.ToString().Replace("xmlns:asp=\"remove\"", "").Replace("<", "<").Replace(">", ">"); sw.Close(); ctrl = Page.ParseControl(result); PlaceHolder1.Controls.Add(ctrl); XDoc.Load(Server.MapPath("~/Xml/Testimonials.xml")); xsl.Load(Server.MapPath("~/XSLT/HomePageTestimonials.xslt")); xsl.Transform(XDoc, xslarg, sw1); result = sw1.ToString().Replace("xmlns:asp=\"remove\"", "").Replace("<", "<").Replace(">", ">"); sw1.Close(); ctrl = Page.ParseControl(result); PlaceHolder2.Controls.Add(ctrl); } }