ParseControl() with inline asp code

Discussion in 'ASP .Net Building Controls' started by Juan Xavier Larrea, Feb 22, 2006.

  1. Greetings,

    How can i parse inline code? I have the following code:

    System.Text.StringBuilder sb = new System.Text.StringBuilder();
    sb.Append("<asp:TextBox id=\"myControl\" runat=\"server\" />");
    sb.Append("<%= \"Hello!\"%>");

    string strControl = sb.ToString();
    Control oControl = Page.ParseControl(strControl);

    The textbox renders properl, but ParseControl() apparently ignores all
    <%...%> inline embedded code (except for page directives).

    Is there a solution?

    Thanks.
     
    Juan Xavier Larrea, Feb 22, 2006
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fox
    Replies:
    0
    Views:
    891
  2. Abhi
    Replies:
    2
    Views:
    963
    E. Robert Tisdale
    Jul 3, 2003
  3. Alvin
    Replies:
    7
    Views:
    733
    E. Robert Tisdale
    May 6, 2005
  4. Replies:
    3
    Views:
    632
  5. Daniel Vallstrom
    Replies:
    2
    Views:
    2,782
    Kevin Bracey
    Nov 21, 2003
  6. Nish
    Replies:
    4
    Views:
    753
    Thomas Stegen
    Oct 8, 2004
  7. TGOS
    Replies:
    3
    Views:
    561
    Kevin Bracey
    Feb 28, 2005
  8. Ajay
    Replies:
    5
    Views:
    631
    Pete Becker
    Apr 1, 2006
Loading...