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. Advertising

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. Matthias Lohrer

    Page.ParseControl drives me crazy

    Matthias Lohrer, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,752
    Matthias Lohrer
    Jul 8, 2003
  2. Matthias Lohrer

    Using Validation Controls with Page.ParseControl

    Matthias Lohrer, Jul 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,596
    Satish Appasani
    Jul 29, 2003
  3. Chris Simeone

    .NET ParseControl() method problem

    Chris Simeone, Dec 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,354
    Chris Simeone
    Dec 10, 2003
  4. Jeremy McPeak

    ParseControl()

    Jeremy McPeak, Dec 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,919
    Rick Strahl [MVP]
    Dec 21, 2003
  5. Fox
    Replies:
    0
    Views:
    820
Loading...

Share This Page