Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. User control confusion

User control confusion

Scheduled Pinned Locked Moved ASP.NET
winformsdesignperformancehelpquestion
13 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Sandeep Akhare

    Hi All, I struck against the meaning of user control. Please i need your comments for this issue As per my knowledge we use user control when there is reusable logic and UI present in the web application. But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page. Means they have almost n number of user controls for n number of pages. Is it proper way? Do we need to have concern for performance issue

    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

    N Offline
    N Offline
    N a v a n e e t h
    wrote on last edited by
    #4

    playing with bugs ) wrote:

    As per my knowledge we use user control when there is reusable logic and UI present in the web application.

    Are you speaking about ascx files ? I think master pages are a good replacement for this.

    playing with bugs ) wrote:

    But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page.

    I don't find any problem in in this design. There might be some reason that they chose this method. May be the user controls was developed by one programmer, and ASPX pages are done by other. So the person who created ASPX pages, don't need to understand what's happening inside the user control. I think it's for easy maintainability. You need to identify, why they used such a method. I don't think that it will make performance problems.

    All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

    S 1 Reply Last reply
    0
    • N N a v a n e e t h

      playing with bugs ) wrote:

      As per my knowledge we use user control when there is reusable logic and UI present in the web application.

      Are you speaking about ascx files ? I think master pages are a good replacement for this.

      playing with bugs ) wrote:

      But here I am allocated to a new project where they are using one user control for each page just to simplify the amount of logic that is on the page.

      I don't find any problem in in this design. There might be some reason that they chose this method. May be the user controls was developed by one programmer, and ASPX pages are done by other. So the person who created ASPX pages, don't need to understand what's happening inside the user control. I think it's for easy maintainability. You need to identify, why they used such a method. I don't think that it will make performance problems.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #5

      Navaneeth, thanks for your comments

      N a v a n e e t h wrote:

      Are you speaking about ascx files ?

      Yes i am saying ASCX files.

      N a v a n e e t h wrote:

      I think it's for easy maintainability

      That's what i wanted (specific answer) What will you say to this sentence.Please give your comments The user controls are used to simplify the amount of logic that is on the page

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      N 1 Reply Last reply
      0
      • S Sandeep Akhare

        Navaneeth, thanks for your comments

        N a v a n e e t h wrote:

        Are you speaking about ascx files ?

        Yes i am saying ASCX files.

        N a v a n e e t h wrote:

        I think it's for easy maintainability

        That's what i wanted (specific answer) What will you say to this sentence.Please give your comments The user controls are used to simplify the amount of logic that is on the page

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #6

        playing with bugs ) wrote:

        The user controls are used to simplify the amount of logic that is on the page

        Well, I think when you use user controls, your logic is not getting simplified. But your code is getting simplified and gives easy readability. Commonly used things can be put in one centralized place.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        S 1 Reply Last reply
        0
        • S Sandeep Akhare

          Michael, Thanks for giving your comments

          Michael Sync wrote:

          If you are using ASP.NET 1x, the answer is Yes.

          I am using ASP.NET 2.0. What makes the difference between 2 ?

          Michael Sync wrote:

          plus, the reason why we used to use the user control is that we want to create the basepage for website themes.

          We can use master page for this. So what should we conclude ?

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          M Offline
          M Offline
          Michael Sync
          wrote on last edited by
          #7

          playing with bugs ) wrote:

          I am using ASP.NET 2.0. What makes the difference between 2 ?

          If you are using ASP.NET 2.0, one user control for one page won't be needed for you anymore. For performance, I don't think that there is any differences between the page and user control..

          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

          S 1 Reply Last reply
          0
          • N N a v a n e e t h

            playing with bugs ) wrote:

            The user controls are used to simplify the amount of logic that is on the page

            Well, I think when you use user controls, your logic is not getting simplified. But your code is getting simplified and gives easy readability. Commonly used things can be put in one centralized place.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #8

            Well then here my question came again as you said

            N a v a n e e t h wrote:

            Commonly used things can be put in one centralized place

            But that user control is going to use by one page and that also single time so there could not be any common things.It contains logic for populating the page(UI) and getting data from UI to data container

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            N 1 Reply Last reply
            0
            • M Michael Sync

              playing with bugs ) wrote:

              I am using ASP.NET 2.0. What makes the difference between 2 ?

              If you are using ASP.NET 2.0, one user control for one page won't be needed for you anymore. For performance, I don't think that there is any differences between the page and user control..

              Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #9

              Michael but if i would have using ASP.NET 1.x then why i can use one user control for 1 page ? Means what makes this difference in 2.0 .. i don't know my question is making any sense or not ? ;P

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              M 1 Reply Last reply
              0
              • S Sandeep Akhare

                Well then here my question came again as you said

                N a v a n e e t h wrote:

                Commonly used things can be put in one centralized place

                But that user control is going to use by one page and that also single time so there could not be any common things.It contains logic for populating the page(UI) and getting data from UI to data container

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                N Offline
                N Offline
                N a v a n e e t h
                wrote on last edited by
                #10

                No idea exactly why the used this method. May be it's their style of coding. But I am sure that it won't make any performance difference.

                All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                S 1 Reply Last reply
                0
                • N N a v a n e e t h

                  No idea exactly why the used this method. May be it's their style of coding. But I am sure that it won't make any performance difference.

                  All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

                  S Offline
                  S Offline
                  Sandeep Akhare
                  wrote on last edited by
                  #11

                  OK Navaneeth Thank you very much for your valuable comments :)

                  Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                  1 Reply Last reply
                  0
                  • S Sandeep Akhare

                    Michael but if i would have using ASP.NET 1.x then why i can use one user control for 1 page ? Means what makes this difference in 2.0 .. i don't know my question is making any sense or not ? ;P

                    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                    M Offline
                    M Offline
                    Michael Sync
                    wrote on last edited by
                    #12

                    When we were using ASP.NET 1x, there is no build-in master page. So, we had to create the base class for that and added the user control dynamically to the page.. but when we moved to ASP.NET 2.0, we don't need that concept anymore..

                    Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

                    S 1 Reply Last reply
                    0
                    • M Michael Sync

                      When we were using ASP.NET 1x, there is no build-in master page. So, we had to create the base class for that and added the user control dynamically to the page.. but when we moved to ASP.NET 2.0, we don't need that concept anymore..

                      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

                      S Offline
                      S Offline
                      Sandeep Akhare
                      wrote on last edited by
                      #13

                      Hmm Thanks Buddy :)

                      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups