Web User Control...I'm missing something basic

Y

YYZ

I am trying to add 5 "Web User Controls" for use on one WebForm. My
idea was to take kind of a wizard approach -- show uc1 and hide the the
other 4...then next run of the page, show uc2 and hide the other 4.
So, I have created 5 usercontrols in my project (ASP.Net using VB and
using VS2003) by right clicking the project and choose "Add Web User
Control".

After I do that, I was expecting to see the 5 usercontrols listed in
the toolbox under "My User Controls" but they aren't. That may be the
real symptom of my problem.

But, to get around that, I just dragged the usercontrol from the
Solution Explorer and dropped it onto my WebForm1 page. It shows up,
but it shows up kind of like a definition, not an object. It is a gray
rectangle with "UserControl - UcPage11" shown (the original name of the
uc is ucPage1). I can't resize it, etc.

I also can't reference the usercontrol in code for the page itself.
UcPage11.visible = True results in UcPage11 being underlined in blue,
meaning that the compiler doesn't know what UcPage11 is.

So, if I change it to ucPage1.Visible = True then it tells me that I
must use an instance of the control, not the definition.

I know that I need to instantiate an instance of ucPage1, but how do I
do that? I know it's probably something stupid, but I can't figure out
what I'm doing wrong.

Obviously, I'm very new to ASP.Net, so if there is a better way to do
this, I'm open to suggestions.

Thanks for any and all help.

Matt
 

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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,122
Latest member
VinayKumarNevatia_
Top