By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Nov 8 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I suggest you use the ASP.NET 2.0 Wizard control to dramatically simplify
your design.

Here's more info:
http://msdn.microsoft.com/msdnmag/is...1/CuttingEdge/

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
"YYZ" <ma********@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>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

Nov 8 '06 #2

P: n/a
YYZ
On Nov 8, 12:34 pm, "Steve C. Orr [MVP, MCSD]" <S...@Orr.netwrote:
I suggest you use the ASP.NET 2.0 Wizard control to dramatically simplify
your design.

Here's more info:http://msdn.microsoft.com/msdnmag/is...1/CuttingEdge/
Thanks Steve, but I'm using .Net 2003, and I don't think that gets me
the 2.0 version of anything, does it?

Matt

Nov 8 '06 #3

P: n/a
No, but it's a great reason to upgrade!
;-)

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
"YYZ" <ma********@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
On Nov 8, 12:34 pm, "Steve C. Orr [MVP, MCSD]" <S...@Orr.netwrote:
>I suggest you use the ASP.NET 2.0 Wizard control to dramatically simplify
your design.

Here's more
info:http://msdn.microsoft.com/msdnmag/is...1/CuttingEdge/

Thanks Steve, but I'm using .Net 2003, and I don't think that gets me
the 2.0 version of anything, does it?

Matt

Nov 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.