LoadControl() problem

Discussion in 'ASP .Net' started by Guest, Aug 31, 2004.

  1. Guest

    Guest Guest

    When I load a UserControl in dynamically using LoadControl(), I have a
    problem where the values from input controls (like the textbox) will not be
    populated into the control in the codebehind.
    For example, if I type a string, eg "Hello" into the textbox,then submit, at
    Page_Load() the Textbox.Text value is an empty string. However the value
    "Hello" is sitting in the Forms collection of the Request object.
    I don't have this problem if the UserControl is statically declared in an
    aspx page using the <%@ Register %> directive.
    Any ideas?
     
    Guest, Aug 31, 2004
    #1
    1. Advertisements

  2. Guest

    Stefan Guest

    How about loading the control in the InitializeComponent section?
     
    Stefan, Aug 31, 2004
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.