LoadControl() problem

Discussion in 'ASP .Net' started by =?Utf-8?B?UmV4VmFu?=, Aug 31, 2004.

  1. 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?
    =?Utf-8?B?UmV4VmFu?=, Aug 31, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?UmV4VmFu?=

    Stefan Guest

    How about loading the control in the InitializeComponent section?

    "RexVan" <> schrieb im Newsbeitrag
    news:...
    > 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?
    >
    Stefan, Aug 31, 2004
    #2
    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. =?Utf-8?B?U3VzaGlTZWFu?=

    LoadControl Compilation problem

    =?Utf-8?B?U3VzaGlTZWFu?=, Mar 6, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    377
    =?Utf-8?B?U3VzaGlTZWFu?=
    Mar 6, 2007
  2. jack
    Replies:
    2
    Views:
    561
  3. lennart
    Replies:
    1
    Views:
    473
    lennart
    Apr 25, 2010
  4. SushiSean

    LoadControl comilation problem.

    SushiSean, Mar 5, 2007, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    115
    SushiSean
    Mar 5, 2007
  5. SushiSean

    LoadControl problem for 3.5

    SushiSean, Oct 24, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    755
    SushiSean
    Oct 24, 2008
Loading...

Share This Page