Web Usercontrol in a Web Usercontrol not displaying...

Discussion in 'ASP .Net Web Controls' started by Kan Grewal, Jul 6, 2004.

  1. Kan Grewal

    Kan Grewal Guest

    Let me explain the subject!...

    I have a very simple web user control (webcontrol2) that consists of a
    textbox and a command button.

    I then have a second web user control (webcontrol1) that has no controls
    placed on it, but has the following code in the page_load event:

    Dim x As New WebUserControl2

    Me.Controls.Add(x)

    I then have a webform that has webcontrol1 placed on it.

    When I run the project I get nothing! No errors, no controls, nothing.

    However, if in wecontrol1, I replace the code with

    Dim x As New TextBox

    Me.Controls.Add(x)

    It works....what's going on - can someone explain, as I'm at a loss.



    Thanks in advance,



    Kan
     
    Kan Grewal, Jul 6, 2004
    #1
    1. Advertising

  2. Maybe it isn't significant, but you talk about the control as webcontrol2
    but you show code with the name WebUserControl2.

    Could it be that simple?

    "Kan Grewal" <> wrote in message
    news:%...
    > Let me explain the subject!...
    >
    > I have a very simple web user control (webcontrol2) that consists of a
    > textbox and a command button.
    >
    > I then have a second web user control (webcontrol1) that has no controls
    > placed on it, but has the following code in the page_load event:
    >
    > Dim x As New WebUserControl2
    >
    > Me.Controls.Add(x)
    >
    > I then have a webform that has webcontrol1 placed on it.
    >
    > When I run the project I get nothing! No errors, no controls, nothing.
    >
    > However, if in wecontrol1, I replace the code with
    >
    > Dim x As New TextBox
    >
    > Me.Controls.Add(x)
    >
    > It works....what's going on - can someone explain, as I'm at a loss.
    >
    >
    >
    > Thanks in advance,
    >
    >
    >
    > Kan
    >
    >
     
    Ken Cox [Microsoft MVP], Jul 7, 2004
    #2
    1. Advertising

  3. Kan Grewal

    Kan Grewal Guest

    Sorry, I should have checked the code when I posted it - that isn't the
    problem.

    k.

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Maybe it isn't significant, but you talk about the control as webcontrol2
    > but you show code with the name WebUserControl2.
    >
    > Could it be that simple?
    >
    > "Kan Grewal" <> wrote in message
    > news:%...
    > > Let me explain the subject!...
    > >
    > > I have a very simple web user control (webcontrol2) that consists of a
    > > textbox and a command button.
    > >
    > > I then have a second web user control (webcontrol1) that has no controls
    > > placed on it, but has the following code in the page_load event:
    > >
    > > Dim x As New WebUserControl2
    > >
    > > Me.Controls.Add(x)
    > >
    > > I then have a webform that has webcontrol1 placed on it.
    > >
    > > When I run the project I get nothing! No errors, no controls, nothing.
    > >
    > > However, if in wecontrol1, I replace the code with
    > >
    > > Dim x As New TextBox
    > >
    > > Me.Controls.Add(x)
    > >
    > > It works....what's going on - can someone explain, as I'm at a loss.
    > >
    > >
    > >
    > > Thanks in advance,
    > >
    > >
    > >
    > > Kan
    > >
    > >

    >
     
    Kan Grewal, Jul 7, 2004
    #3
    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. huobazi
    Replies:
    1
    Views:
    711
    David Waz...
    Jul 3, 2003
  2. Replies:
    0
    Views:
    489
  3. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    195
  4. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    195
    vatech1993
    Dec 11, 2004
  5. Event not firing in usercontrol inside usercontrol

    , Dec 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    165
Loading...

Share This Page