Use XSLT to Create an ASP.NET Page with ASP.NET Server Controls

Use XSLT to Create an ASP.NET Page with ASP.NET Server Controls

Just write the HTML-Tag for the ASP.NET Control into the XSLT:

																					true																true																Priority

That’s what the following code does:

Protected ctlXML As PlaceHolderDim oXMLDoc As System.Xml.XPath.XPathDocumentDim oXMLTrans As System.Xml.Xsl.XslTransformDim oSW As System.IO.StringWriterDim sHTML As StringDim oCtl As ControloXMLDoc = New System.Xml.XPath.XPathDocument("...")oXMLTrans = New System.Xml.Xsl.XslTransform'load the StylesheetoXMLTrans.Load(Server.MapPath("..."))'Transform XML to HTMLoSW = New System.IO.StringWriteroXMLTrans.Transform(oXMLDoc, Nothing, oSW, Nothing)sHTML = oSW.ToStringIf Not sHTML Is Nothing Then  'Remove the Definition for the "namespace" ASP, which has been created  sHTML = sHTML.Replace("xmlns:asp=""remove""", "")End IfoCtl = Page.ParseControl(sHTML)ctlXML.Controls.Clear()ctlXML.Controls.Add(oCtl)
See also  5 Tips for Working With an Onsite Interpreter

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist