ASP.NET Server Controls using XML/XSL

Scenario

I have developed a framework that allows me to have multiple XSL templates transformed onto an ASP.NET web form. This works well without any ASP.Net server controls on the XSL templates. The question I wanted answered is how to have ASP.NET server controls on a XSL template so that I can dynamically create controls from XML files.

Solution

I found a great article from John Chapman (see below) that explains this in detail.By applying xmlns:asp=”remove” to the element, this tells the parser to apply the format to each server control. i.e. .All is needed now is to do the transformation, remove the namespace from the outputted code and parse the controls to the web form. This also means that event handlers need to be dynamically added if the control is being dynamically created!

Its worth checking out the article below for a better explanation!

References:

John Chapman – Creating Dynamic ASP.Net Server Controls Using XML
http://www.dnzone.com/showDetail.asp?TypeId=2&NewsId=151&LinkFile=page3.htm