Hi there, <BR><BR>I&#039;m currently using an XML file combined with an XSLT to generate my server controls (similar to the method as per http://www.devarticles.com/c/a/ASP.NET/Creating-Dynamic-ASP.NET-Server-Controls-Using-XML/ ). <BR><BR>The problem is - I want to use the XSLT transform to add a UserControl (custom made) to the webform, setting various properties on the control <BR><BR>However, I cannot set the custom properties on the object - as I get a null reference exception. The null reference exception occurs on the following line - which parses the &#039;result&#039; of the XML transform (i.e. the "html/xml" defining the page) <BR><BR>[CODE language="VB.NET"] <BR>Dim ctrls As Control = Page.ParseControl(result)<BR>[/CODE]<BR><BR>The following passed into the Page.Parsecontrol correctly renders the UserControl (testcontrol), correctly assigning the control the id of Q2 <BR><BR>[CODE language="VB.NET"] <BR> &#060;uc1:testcontrol id="q2" runat="server" /&#062;<BR>[/CODE]<BR><BR>However, the following code brings up a NullRef Exception on the ParseControl method <BR><BR>[CODE language="VB.NET"] <BR> &#060;uc1:testcontrol id="q2" QuestTest="blahblah" runat="server" /&#062;<BR>[/CODE]<BR><BR>If I drag and drop the testcontrol to the form and set the property as per the second example, it works. Clearly ParseControl is not instantiating my usercontrol before it tries to assign the property (I can tell this by it never hitting the INIT event of the UserControl). <BR><BR>Is there any way to overcome this? <BR><BR><BR>Thanks for your help! <BR><BR><BR>Note<BR><BR>1: In order to add my UserControl to the page - I had to prepend a &#060;%@ Register TagPrefix=""uc1"" (blah blah) In order for the page to identify & render my UserControl.<BR>2: I should have added, all QuestTest is <BR>[CODE language="VB.NET"] <BR> Public Property QuestTest() As String<BR> Get<BR> Return Me.lblQuestion.Text<BR> End Get<BR> Set(ByVal Value As String)<BR> Me.lblQuestion.Text = Value<BR> End Set<BR> End Property<BR>[/CODE]<BR><BR><BR><BR>