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. SharePoint
  4. Improving performance of SharePoint Web part s

Improving performance of SharePoint Web part s

Scheduled Pinned Locked Moved SharePoint
questionsharepointwpfperformancediscussion
7 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.
  • A Offline
    A Offline
    arut jothi
    wrote on last edited by
    #1

    Hi, This question is regarding the best practice to be followed while developing web parts. In developing web parts, the CreateChildControls method can be programmed in 2 ways, Create all the required controls inside this method, set their properties and call 'this.Controls.Add(xxxx)' for each control created. or Create the controls to be rendered in web part as a web user control i.e., .ascx file and deploy this control in the 12 hive's Control Templates folder. In the 'CreateChildControl' method, load this web user control and call 'this.Controls.Add(xxxx)'. When developing a web part with complex controls or rather huge number of controls in it, which one of the above is best in terms of performance and why? Thanks Arut

    N P 2 Replies Last reply
    0
    • A arut jothi

      Hi, This question is regarding the best practice to be followed while developing web parts. In developing web parts, the CreateChildControls method can be programmed in 2 ways, Create all the required controls inside this method, set their properties and call 'this.Controls.Add(xxxx)' for each control created. or Create the controls to be rendered in web part as a web user control i.e., .ascx file and deploy this control in the 12 hive's Control Templates folder. In the 'CreateChildControl' method, load this web user control and call 'this.Controls.Add(xxxx)'. When developing a web part with complex controls or rather huge number of controls in it, which one of the above is best in terms of performance and why? Thanks Arut

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Neither is better or worse in terms of performance. Performance is more related to how it was the coded and how it functions. In SharePoint 2010 a visual webpart, an ascx, can't be deployed as a sandboxed solution (there are ways, but ignore them for this discussion) so you would be limited to the CreateChild method.


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      • A arut jothi

        Hi, This question is regarding the best practice to be followed while developing web parts. In developing web parts, the CreateChildControls method can be programmed in 2 ways, Create all the required controls inside this method, set their properties and call 'this.Controls.Add(xxxx)' for each control created. or Create the controls to be rendered in web part as a web user control i.e., .ascx file and deploy this control in the 12 hive's Control Templates folder. In the 'CreateChildControl' method, load this web user control and call 'this.Controls.Add(xxxx)'. When developing a web part with complex controls or rather huge number of controls in it, which one of the above is best in terms of performance and why? Thanks Arut

        P Offline
        P Offline
        peac3maker
        wrote on last edited by
        #3

        I don't know wether it has an impact on performance, but I've read in several best practice documents, that whenever possible the CreateChildControl should only be used for the final polish. Unlike ASP.NET Web controls, they are defined and rendered with templates. http://msdn.microsoft.com/en-us/library/bb687949(v=office.12).aspx[^] Check the "Using Web Controls" part.

        N 1 Reply Last reply
        0
        • P peac3maker

          I don't know wether it has an impact on performance, but I've read in several best practice documents, that whenever possible the CreateChildControl should only be used for the final polish. Unlike ASP.NET Web controls, they are defined and rendered with templates. http://msdn.microsoft.com/en-us/library/bb687949(v=office.12).aspx[^] Check the "Using Web Controls" part.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Coded webparts and visual webparts are two separate animals. The point of a visual webpart is to not needing to use the CreateChildControls method yourself, it is handled in the background. You can't give a visual webpart a final polish and switch to using this method. You may as well have started there in the first place.


          I know the language. I've read a book. - _Madmatt

          P 1 Reply Last reply
          0
          • N Not Active

            Coded webparts and visual webparts are two separate animals. The point of a visual webpart is to not needing to use the CreateChildControls method yourself, it is handled in the background. You can't give a visual webpart a final polish and switch to using this method. You may as well have started there in the first place.


            I know the language. I've read a book. - _Madmatt

            P Offline
            P Offline
            peac3maker
            wrote on last edited by
            #5

            I completely agree with you. If you're able to make a visual webpart, you should do it.

            N 1 Reply Last reply
            0
            • P peac3maker

              I completely agree with you. If you're able to make a visual webpart, you should do it.

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              peac3maker wrote:

              If you're able to make a visual webpart, you should do it.

              I didn't say that. You should choose the technology and techniques that fit the situation. Whether that is a visual web part or a more traditional one.


              I know the language. I've read a book. - _Madmatt

              A 1 Reply Last reply
              0
              • N Not Active

                peac3maker wrote:

                If you're able to make a visual webpart, you should do it.

                I didn't say that. You should choose the technology and techniques that fit the situation. Whether that is a visual web part or a more traditional one.


                I know the language. I've read a book. - _Madmatt

                A Offline
                A Offline
                arut jothi
                wrote on last edited by
                #7

                Thanks for the response.

                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