Web Usercontrol in a Web Usercontrol not displaying...

K

Kan Grewal

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
 
K

Ken Cox [Microsoft MVP]

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?
 
K

Kan Grewal

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

k.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top