User control development using VS 2003

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lloyd Sheen

    User control development using VS 2003

    Is there any one who has actually done this. I have now scanned more web
    articles about this with the realization that not one of them (including
    MSDN docs) outlines how to do this. This is beyond frustration. It seems
    that with every new VS release the documentation falls further behind.

    What I want to do should be simple but I can find no way to do it with VS
    with any visual designer support. I thought the 'V' in VS stood for Visual.

    Can anyone point me to a resource please???


  • Ruslan Shlain

    #2
    Re: User control development using VS 2003

    Whould be nice to know what the problem is.


    "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in message
    news:6y3Cb.1284 9$kr2.12400@new s01.bloor.is.ne t.cable.rogers. com...[color=blue]
    > Is there any one who has actually done this. I have now scanned more web
    > articles about this with the realization that not one of them (including
    > MSDN docs) outlines how to do this. This is beyond frustration. It seems
    > that with every new VS release the documentation falls further behind.
    >
    > What I want to do should be simple but I can find no way to do it with VS
    > with any visual designer support. I thought the 'V' in VS stood for[/color]
    Visual.[color=blue]
    >
    > Can anyone point me to a resource please???
    >
    >[/color]


    Comment

    • Chris Jackson

      #3
      Re: User control development using VS 2003

      What is it that you are trying to do? User controls (ascx controls) have
      designer support. If you are attempting to make a custom control (sometimes
      called a server control) then you don't get designer support, because it's
      all about handling events and spitting out HTML (or any plain text, really)
      when it is told to render. If you can give details, we can try and point you
      in the right direction. I have done both extensively.

      --
      Chris Jackson
      Software Engineer
      Microsoft MVP - Windows Client
      Windows XP Associate Expert
      --
      More people read the newsgroups than read my email.
      Reply to the newsgroup for a faster response.
      (Control-G using Outlook Express)
      --

      "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in message
      news:6y3Cb.1284 9$kr2.12400@new s01.bloor.is.ne t.cable.rogers. com...[color=blue]
      > Is there any one who has actually done this. I have now scanned more web
      > articles about this with the realization that not one of them (including
      > MSDN docs) outlines how to do this. This is beyond frustration. It seems
      > that with every new VS release the documentation falls further behind.
      >
      > What I want to do should be simple but I can find no way to do it with VS
      > with any visual designer support. I thought the 'V' in VS stood for[/color]
      Visual.[color=blue]
      >
      > Can anyone point me to a resource please???
      >
      >[/color]


      Comment

      • Lloyd Sheen

        #4
        Re: User control development using VS 2003

        Please read my previous posts (don't want to clog group with repeats).
        Should show just prior to this post.

        Thanks

        "Chris Jackson" <chrisjATmvpsDO TorgNOSPAM> wrote in message
        news:OqyLNACwDH A.2372@TK2MSFTN GP09.phx.gbl...[color=blue]
        > What is it that you are trying to do? User controls (ascx controls) have
        > designer support. If you are attempting to make a custom control[/color]
        (sometimes[color=blue]
        > called a server control) then you don't get designer support, because it's
        > all about handling events and spitting out HTML (or any plain text,[/color]
        really)[color=blue]
        > when it is told to render. If you can give details, we can try and point[/color]
        you[color=blue]
        > in the right direction. I have done both extensively.
        >
        > --
        > Chris Jackson
        > Software Engineer
        > Microsoft MVP - Windows Client
        > Windows XP Associate Expert
        > --
        > More people read the newsgroups than read my email.
        > Reply to the newsgroup for a faster response.
        > (Control-G using Outlook Express)
        > --
        >
        > "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in[/color]
        message[color=blue]
        > news:6y3Cb.1284 9$kr2.12400@new s01.bloor.is.ne t.cable.rogers. com...[color=green]
        > > Is there any one who has actually done this. I have now scanned more[/color][/color]
        web[color=blue][color=green]
        > > articles about this with the realization that not one of them (including
        > > MSDN docs) outlines how to do this. This is beyond frustration. It[/color][/color]
        seems[color=blue][color=green]
        > > that with every new VS release the documentation falls further behind.
        > >
        > > What I want to do should be simple but I can find no way to do it with[/color][/color]
        VS[color=blue][color=green]
        > > with any visual designer support. I thought the 'V' in VS stood for[/color]
        > Visual.[color=green]
        > >
        > > Can anyone point me to a resource please???
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Lloyd Sheen

          #5
          Re: User control development using VS 2003

          Please check my prior posts (don't want to clog newgroup with dups)

          Thanks Lloyd Sheen

          "Ruslan Shlain" <rshlain@hotmai l.com> wrote in message
          news:%23Y9NN2Bw DHA.684@TK2MSFT NGP09.phx.gbl.. .[color=blue]
          > Whould be nice to know what the problem is.
          >
          >
          > "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in[/color]
          message[color=blue]
          > news:6y3Cb.1284 9$kr2.12400@new s01.bloor.is.ne t.cable.rogers. com...[color=green]
          > > Is there any one who has actually done this. I have now scanned more[/color][/color]
          web[color=blue][color=green]
          > > articles about this with the realization that not one of them (including
          > > MSDN docs) outlines how to do this. This is beyond frustration. It[/color][/color]
          seems[color=blue][color=green]
          > > that with every new VS release the documentation falls further behind.
          > >
          > > What I want to do should be simple but I can find no way to do it with[/color][/color]
          VS[color=blue][color=green]
          > > with any visual designer support. I thought the 'V' in VS stood for[/color]
          > Visual.[color=green]
          > >
          > > Can anyone point me to a resource please???
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Hermit Dave

            #6
            Re: User control development using VS 2003

            Try this

            Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


            Its got a few things on controls. my user control if you mean .ascx objects.
            Well they are just the normal aspx files which are stripped of all the extra
            tags
            all you have to do is rename the aspx file into ascx and then change
            Codebehind="Mod uleTitle.ascx.c s"
            to point it to ascx instead of earlier aspx...
            and you user control is up and running.

            Unfortunately when you load it it acts like a server side include and its
            not parse so all you see is a greyish object with UserControl-id of control
            when added to an asp.net page (aspx)

            Hope this helped...

            Hermit Dave

            "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in message
            news:6y3Cb.1284 9$kr2.12400@new s01.bloor.is.ne t.cable.rogers. com...[color=blue]
            > Is there any one who has actually done this. I have now scanned more web
            > articles about this with the realization that not one of them (including
            > MSDN docs) outlines how to do this. This is beyond frustration. It seems
            > that with every new VS release the documentation falls further behind.
            >
            > What I want to do should be simple but I can find no way to do it with VS
            > with any visual designer support. I thought the 'V' in VS stood for[/color]
            Visual.[color=blue]
            >
            > Can anyone point me to a resource please???
            >
            >[/color]


            Comment

            • Lloyd Sheen

              #7
              Re: User control development using VS 2003

              What I am trying to do is use code that works on one page in other pages.
              It is a set of controls that access information from a SQL Server and
              populate a list depending on certain criteria.

              I need to have the same functionallity on several pages. This is what I
              would think is the best cause for the use of user controls.

              I am new to ASP.NET and have taken the idea of a user control from previous
              VS types (VB6). I would think you could create a user control for ASP by
              creating the child controls, add code to put functionallity to those
              controls (server side) and then be able to add that control to ASP pages.
              This does not seem to be a viable thing to do in VS 2003.


              Comment

              • Lloyd Sheen

                #8
                Re: User control development using VS 2003

                This does nothing for me. I need to be able to access other controls on the
                page. Be able to position the control. Actually what I want to know is if
                I can from scratch create a new user control . Add child controls to this.
                Add code to this. Add properties to this. Use the resultant control.

                Sorry if I seem bitchy but I am now on the 42nd page of the google search
                and still no resolution.

                Having VS 2003 at the present is as usefull as notepad. And notepad takes
                less memory.


                Comment

                • Hermit Dave

                  #9
                  Re: User control development using VS 2003

                  Well my friend what you are talking bout is a custom web control.
                  You have two options.
                  1. Creating everything yourself (Even emitting the correct html code.)
                  2. User a composite control which is exactly what it means. You consume
                  other controls and delegate the task. But you have to ensure that you call
                  EnsureChildCont rols has been called

                  Yes you can define your own properties and you can set one of the properties
                  to style. Which will give you the position of control
                  If you need style settings for child controls too... then try something like
                  datagrid... you have PagerStyle and ItemStyle.

                  I think i have seen a book from wrox press on custom web controls. Should
                  sort you out.... To start up just look at the link i gave you earlier. or
                  try this one...



                  for creating custom web controls.... You can look on asp.net books as
                  well... they generally do have a chapter on creating controls.. and atleast
                  an example of each...

                  Hermit Dave

                  "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in message
                  news:To4Cb.1297 7$kr2.6944@news 01.bloor.is.net .cable.rogers.c om...[color=blue]
                  > This does nothing for me. I need to be able to access other controls on[/color]
                  the[color=blue]
                  > page. Be able to position the control. Actually what I want to know is[/color]
                  if[color=blue]
                  > I can from scratch create a new user control . Add child controls to[/color]
                  this.[color=blue]
                  > Add code to this. Add properties to this. Use the resultant control.
                  >
                  > Sorry if I seem bitchy but I am now on the 42nd page of the google search
                  > and still no resolution.
                  >
                  > Having VS 2003 at the present is as usefull as notepad. And notepad takes
                  > less memory.
                  >
                  >[/color]


                  Comment

                  • Lloyd Sheen

                    #10
                    Re: User control development using VS 2003

                    So then the answer is no. You cannot use VS 2003 to do this other than as
                    an expensive notepad??


                    "Hermit Dave" <hermitd.REMOVE @CAPS.AND.DOTS. hotmail.com> wrote in message
                    news:eoHMJoCwDH A.3496@TK2MSFTN GP11.phx.gbl...[color=blue]
                    > Well my friend what you are talking bout is a custom web control.
                    > You have two options.
                    > 1. Creating everything yourself (Even emitting the correct html code.)
                    > 2. User a composite control which is exactly what it means. You consume
                    > other controls and delegate the task. But you have to ensure that you call
                    > EnsureChildCont rols has been called
                    >
                    > Yes you can define your own properties and you can set one of the[/color]
                    properties[color=blue]
                    > to style. Which will give you the position of control
                    > If you need style settings for child controls too... then try something[/color]
                    like[color=blue]
                    > datagrid... you have PagerStyle and ItemStyle.
                    >
                    > I think i have seen a book from wrox press on custom web controls. Should
                    > sort you out.... To start up just look at the link i gave you earlier. or
                    > try this one...
                    >
                    > http://www.dotnetjunkies.com/quickst...authoring.aspx
                    >
                    > for creating custom web controls.... You can look on asp.net books as
                    > well... they generally do have a chapter on creating controls.. and[/color]
                    atleast[color=blue]
                    > an example of each...
                    >
                    > Hermit Dave
                    >
                    > "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in[/color]
                    message[color=blue]
                    > news:To4Cb.1297 7$kr2.6944@news 01.bloor.is.net .cable.rogers.c om...[color=green]
                    > > This does nothing for me. I need to be able to access other controls on[/color]
                    > the[color=green]
                    > > page. Be able to position the control. Actually what I want to know is[/color]
                    > if[color=green]
                    > > I can from scratch create a new user control . Add child controls to[/color]
                    > this.[color=green]
                    > > Add code to this. Add properties to this. Use the resultant control.
                    > >
                    > > Sorry if I seem bitchy but I am now on the 42nd page of the google[/color][/color]
                    search[color=blue][color=green]
                    > > and still no resolution.
                    > >
                    > > Having VS 2003 at the present is as usefull as notepad. And notepad[/color][/color]
                    takes[color=blue][color=green]
                    > > less memory.
                    > >
                    > >[/color]
                    >
                    >[/color]


                    Comment

                    • Hermit Dave

                      #11
                      Re: User control development using VS 2003

                      Well if you can read and understand then... yes you can but you have to work
                      for it....
                      You can't just drag and drop and expect everything to work.... try using a
                      ..net control similar to activex control for that

                      Hermit Dave

                      "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in message
                      news:F%4Cb.1306 8$kr2.3804@news 01.bloor.is.net .cable.rogers.c om...[color=blue]
                      > So then the answer is no. You cannot use VS 2003 to do this other than as
                      > an expensive notepad??
                      >
                      >
                      > "Hermit Dave" <hermitd.REMOVE @CAPS.AND.DOTS. hotmail.com> wrote in message
                      > news:eoHMJoCwDH A.3496@TK2MSFTN GP11.phx.gbl...[color=green]
                      > > Well my friend what you are talking bout is a custom web control.
                      > > You have two options.
                      > > 1. Creating everything yourself (Even emitting the correct html code.)
                      > > 2. User a composite control which is exactly what it means. You consume
                      > > other controls and delegate the task. But you have to ensure that you[/color][/color]
                      call[color=blue][color=green]
                      > > EnsureChildCont rols has been called
                      > >
                      > > Yes you can define your own properties and you can set one of the[/color]
                      > properties[color=green]
                      > > to style. Which will give you the position of control
                      > > If you need style settings for child controls too... then try something[/color]
                      > like[color=green]
                      > > datagrid... you have PagerStyle and ItemStyle.
                      > >
                      > > I think i have seen a book from wrox press on custom web controls.[/color][/color]
                      Should[color=blue][color=green]
                      > > sort you out.... To start up just look at the link i gave you earlier.[/color][/color]
                      or[color=blue][color=green]
                      > > try this one...
                      > >
                      > >[/color][/color]
                      http://www.dotnetjunkies.com/quickst...authoring.aspx[color=blue][color=green]
                      > >
                      > > for creating custom web controls.... You can look on asp.net books as
                      > > well... they generally do have a chapter on creating controls.. and[/color]
                      > atleast[color=green]
                      > > an example of each...
                      > >
                      > > Hermit Dave
                      > >
                      > > "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in[/color]
                      > message[color=green]
                      > > news:To4Cb.1297 7$kr2.6944@news 01.bloor.is.net .cable.rogers.c om...[color=darkred]
                      > > > This does nothing for me. I need to be able to access other controls[/color][/color][/color]
                      on[color=blue][color=green]
                      > > the[color=darkred]
                      > > > page. Be able to position the control. Actually what I want to know[/color][/color][/color]
                      is[color=blue][color=green]
                      > > if[color=darkred]
                      > > > I can from scratch create a new user control . Add child controls to[/color]
                      > > this.[color=darkred]
                      > > > Add code to this. Add properties to this. Use the resultant control.
                      > > >
                      > > > Sorry if I seem bitchy but I am now on the 42nd page of the google[/color][/color]
                      > search[color=green][color=darkred]
                      > > > and still no resolution.
                      > > >
                      > > > Having VS 2003 at the present is as usefull as notepad. And notepad[/color][/color]
                      > takes[color=green][color=darkred]
                      > > > less memory.
                      > > >
                      > > >[/color]
                      > >
                      > >[/color]
                      >
                      >[/color]


                      Comment

                      • Chris Jackson

                        #12
                        Re: User control development using VS 2003

                        What you want to do seems fairly straightforward . You just need to create a
                        user control, which you can use the visual designer to do. Then, you need to
                        go in to the code behind and customize based on your needs. Let me see if I
                        can expand your scenario in a way that is meaningful. You want to get
                        information from SQL Server, and what you intend to display is dependent on
                        what page you are sitting on. Well, then your develop a user control that
                        displays a generic DataGrid that you can later databind to some (still to be
                        defined) data source. Then, you can access the hosting page using the Parent
                        property of that control, if the information is there. Or, you could store
                        that information in a session variable. There are countless ways to
                        develop - you have a completely object oriented environment in which to
                        play, and you just need to design your architecture so you can phrase your
                        "question" to this user control in a completely generic way. In fact, I have
                        several sites that contain only a single aspx control, and the entire
                        application logic determines what user controls should be loaded, and what
                        data they could contain. The framework is extremely powerful. If you can
                        phrase your question more specifically, then perhaps we can give you tips
                        and tricks to get you to the answer in the most efficient way - just wanting
                        to reuse code is a question that the UserControl class answers rather
                        succinctly.

                        --
                        Chris Jackson
                        Software Engineer
                        Microsoft MVP - Windows Client
                        Windows XP Associate Expert
                        --
                        More people read the newsgroups than read my email.
                        Reply to the newsgroup for a faster response.
                        (Control-G using Outlook Express)
                        --

                        "Lloyd Sheen" <sqlguyremoveal lofthis@tostops pamhotmail.com> wrote in message
                        news:Ib4Cb.1294 5$kr2.9938@news 01.bloor.is.net .cable.rogers.c om...[color=blue]
                        > What I am trying to do is use code that works on one page in other pages.
                        > It is a set of controls that access information from a SQL Server and
                        > populate a list depending on certain criteria.
                        >
                        > I need to have the same functionallity on several pages. This is what I
                        > would think is the best cause for the use of user controls.
                        >
                        > I am new to ASP.NET and have taken the idea of a user control from[/color]
                        previous[color=blue]
                        > VS types (VB6). I would think you could create a user control for ASP by
                        > creating the child controls, add code to put functionallity to those
                        > controls (server side) and then be able to add that control to ASP pages.
                        > This does not seem to be a viable thing to do in VS 2003.
                        >
                        >[/color]


                        Comment

                        Working...