0

I believe I have seen a method for doing this, but I do not remember.

I am trying to load a control using something like:

string str = "<asp:label id=\"myLabel\" runat=\"server\" />";

Control ctrl = SomeMagicalLoadControlMethod(str);
Page.controls.add(ctrl);

Is there a method for this?

And yes, I am familiar with the LoadControl method, but that's not what I need.

Update:

The method I was thinking of was ParseControl.

To help anyone else out..

Control ctrl = ParseControl("<asp:label id=\"myLabel\" runat=\"server\" />");
McGarnagle
  • 101,349
  • 31
  • 229
  • 260

1 Answers1

1

I cannot imagine doing something like what you describe. It looks like such as horrendous thing to do that if indeed this is possible, I would rather forget that I saw it and rethink my approach.

Icarus
  • 63,293
  • 14
  • 100
  • 115
  • Looks like he want to do some dynamic control stuff. But better checkout any MVC framework and eventually add a client MVC like ExtJS as well... – YvesR Apr 30 '12 at 19:31
  • The method i was thinking of is ParseControl and it cant be so horrendous if its an actual method. – Dan Rivera Apr 30 '12 at 19:58