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

Discussion in 'ASP .Net' started by YYZ, Nov 8, 2006.

  1. YYZ

    YYZ Guest

    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
    YYZ, Nov 8, 2006
    #1
    1. Advertising

  2. 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/issues/04/11/CuttingEdge/

    --
    I hope this helps,
    Steve C. Orr
    MCSD, MVP, CSM
    http://SteveOrr.net


    "YYZ" <> wrote in message
    news:...
    >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
    >
    Steve C. Orr [MVP, MCSD], Nov 8, 2006
    #2
    1. Advertising

  3. YYZ

    YYZ Guest

    On Nov 8, 12:34 pm, "Steve C. Orr [MVP, MCSD]" <> wrote:
    > 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/issues/04/11/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
    YYZ, Nov 8, 2006
    #3
  4. No, but it's a great reason to upgrade!
    ;-)

    --
    I hope this helps,
    Steve C. Orr
    MCSD, MVP, CSM
    http://SteveOrr.net


    "YYZ" <> wrote in message
    news:...
    > On Nov 8, 12:34 pm, "Steve C. Orr [MVP, MCSD]" <> wrote:
    >> 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/issues/04/11/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
    >
    Steve C. Orr [MVP, MCSD], Nov 8, 2006
    #4
    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. ABC
    Replies:
    1
    Views:
    2,634
    Larry
    Oct 4, 2005
  2. mivhaelveloz
    Replies:
    0
    Views:
    447
    mivhaelveloz
    May 1, 2006
  3. Geoff Pennington

    Forms authentication across apps - missing something basic?

    Geoff Pennington, Oct 6, 2005, in forum: ASP .Net Security
    Replies:
    6
    Views:
    183
    Paul Glavich [MVP ASP.NET]
    Oct 13, 2005
  4. Chris Szabo

    Missing web control reference in user control

    Chris Szabo, Jun 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    166
    Chris Szabo
    Jun 8, 2006
  5. Don Norcott

    Help missing something BASIC

    Don Norcott, Oct 20, 2010, in forum: Ruby
    Replies:
    10
    Views:
    188
    Robert Klemme
    Oct 21, 2010
Loading...

Share This Page