Building Run-time Dynamic Controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using XML/XSL to build a dynamic asp.net control at runtime. So the
result of the XML/XSL transformation may result in a string such as:

<asp:TextBox id="TextBox1" runat="server">
</asp:TextBox>

I then use Page.parsecontrols method to create the control from the string
above.

This works fine for most situations but I now need to be able to have a
script block in the string, for example:


<asp:TextBox id="TextBox1" runat="server" Text='<%#
DataBinder.Eval(DataView1, "[0].au_lname") %>'>
</asp:TextBox>

The problem though, is that when I run the page, I get an error telling me
that the script block is not compiled.

Is there a way for me to compile this at runtime?

Many thanks
K
 
Just another quick detail. The concept is that I'm using xml/xsl to build the
asp.net page on the fly. Hope this makes sense, if not please post and I'll
expand on it.

Thanks
K
 
Back
Top